Integers: 1's complement
Another way to represent negative values:
Negate
(flip) each bit.
Use the
operator ~
to represent flipping each bit.
~B is B with all of its bits flipped.
This is called
1's complement
(1C).