
-----------------------------------
registration
Tue Jul 06, 2010 3:06 pm

decimal to negative hex?
-----------------------------------
can someone please explain the whole process in detail? (i read somewhere you add 2^32 and then convert to hex.. but then doesn't that mean each hexadecimal number has 2 decimal answers?)

-----------------------------------
DemonWasp
Tue Jul 06, 2010 4:46 pm

RE:decimal to negative hex?
-----------------------------------
Negative numbers are stored on most computers with a system called unsigned integers. An unsigned integer can represent a higher maximum number, but cannot ever represent negative numbers. The lowest number is 0 (000000000...) and the highest number is 2^32-1 (1111111111...)

In this sense, you can consider any given hexadecimal value to have two different interpretations - one signed, one unsigned. There are other possible ways to encode numbers in hexadecimal, but this is the most common method.
