Page 1 of 1
18F46K22 ULONG
Posted: Mon May 21, 2012 9:50 pm
by saschech@gmx.de
Hello
I have trouble with the ULONG variable.
I expect 42949697295 >> I show 24335??
Please help
Regards Wolfgang
Re: 18F46K22 ULONG
Posted: Tue May 22, 2012 10:17 am
by JonnyW
Hi Wolfgang.
The problem is that a ULONG is a 32-bit number. 42949697295 is hex A00005F0F - in 32 bits this is 00005F0F (the 'A' is lost in integer overflow).
For the hex number A0005F0F use the decimal 2684378895.
Cheers,
Jonny
Re: 18F46K22 ULONG
Posted: Tue May 22, 2012 10:39 am
by saschech@gmx.de
Hello Jonny
I think the information in the build-window are not right.
If I put in your new number show......
Regards Wolfgang
Re: 18F46K22 ULONG
Posted: Wed May 23, 2012 11:32 pm
by JonnyW
Hi Wolfgang. Yes, there is an issue where unsigned values are shown as signed in the watch window. The value is correct, it is just the signed equivalent. The hex value is always unsigned.
Cheers,
Jonny