xavier.batlle
Active member
- Local time
- Today, 04:37
- Joined
- Sep 1, 2023
- Messages
- 109
If I print some hexadecimal values, this is the result:
All hex decimal values from &H0000 to &HFFFF are considered signed integer type so the &HFFFF value is -1. Greater values than &HFFFF are considered long values and work properly from values lower than &H7FFFFFFF.
So If you have to work with hexadecimal numbers, they must be explicity converted to avoid these issues.
Code:
? &HF
15
? &HFF
255
? &HFFF
4095
? &HFFFF
-1
? &HFFFFF
1048575
? &HFFFFFF
16777215
? &HFFFF = &HFFFFFFFF
True
? &HFFFF , &HFFFFFFFF
-1 -1
All hex decimal values from &H0000 to &HFFFF are considered signed integer type so the &HFFFF value is -1. Greater values than &HFFFF are considered long values and work properly from values lower than &H7FFFFFFF.
So If you have to work with hexadecimal numbers, they must be explicity converted to avoid these issues.
Last edited: