posted 19 years ago
And to understand why Jay's formula works, you can write out the bits.
Again, the formula is
~x = (x+1) * (-1)
or
~x = -(x+1)
You can see the formula in action from this chart of values. Remember that 11111111 is -1.
SCJA 1.0 (98%), SCJP 1.4 (98%)