Hello
I have trouble with the ULONG variable.
I expect 42949697295 >> I show 24335??
Please help
Regards Wolfgang
18F46K22 ULONG
Moderator: Benj
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: 18F46K22 ULONG
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
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
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: 18F46K22 ULONG
Hello Jonny
I think the information in the build-window are not right.
If I put in your new number show......
Regards Wolfgang
I think the information in the build-window are not right.
If I put in your new number show......
Regards Wolfgang
- Attachments
-
- ULONG new.gif
- (49.26 KiB) Downloaded 658 times
-
- value.gif
- (63.72 KiB) Downloaded 658 times
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: 18F46K22 ULONG
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
Cheers,
Jonny