Difference between revisions of "Help File:Unsigned values"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
+ | [[Category:Help]] | ||
In short, a value can hold a negative value if it is a signed value. | In short, a value can hold a negative value if it is a signed value. | ||
This is done by inverting all the bits. All 0's become 1's and 1's become 0's. Then the resulting value is incremented by 1. | This is done by inverting all the bits. All 0's become 1's and 1's become 0's. Then the resulting value is incremented by 1. |
Latest revision as of 12:14, 19 March 2017
In short, a value can hold a negative value if it is a signed value. This is done by inverting all the bits. All 0's become 1's and 1's become 0's. Then the resulting value is incremented by 1.
example:
12 = 00001100
invert = 11110011
-12 = 11110100 (notice that if this was an unsigned value this would be 244; because 256-12=244)