What is the logic behind "possible misuse of hexadecimal literal notation"? #1
-
|
This code i = ((l1 Xor &H8000) + l2 * 256) Xor &H8000Gets warning: For me those Hex codes are clearly being used to set bits, rather than as numbers. So what is the logic there? l = (((l1 + l2 * 256 + l3 * 256 ^ 2) Xor &H80000000) + l4 * 256 ^ 3) Xor &H80000000this looks similar but there is no warning |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Those aren't the same thing. |
Beta Was this translation helpful? Give feedback.
-
|
Put simply
Bits are numbers :) |
Beta Was this translation helpful? Give feedback.
Those aren't the same thing.
&H8000evaluates to -32768 whereas&H8000&evaluates to 32768. If the terms are allIntegers you won't notice any difference. However if they areLong, what you are doing is the difference between&HFFFF8000&vs&H00008000&which can mess up the bits in the upper portion of the value.