C++ Language/Type/BitwiseRepresentation/NegativeValue

From Wikibooks, open books for an open world
Jump to navigation Jump to search

The negative value of an integer could be stored as either "2's complement" (-1 viewed as unsigned char is 0B11111111) or "1's complement" (it is 0B11111110).

Additional information about representing a negative value (includes interactive examples)