Quote:
Originally posted by rbayer
I'm not going to argue over this one: x86 (and most other architectures) use two's complement for representing negative numbers. Under that system, you invert all the bits and add 1. It's just the way it is. Don't believe me? Go ahead and read this.
|
No need to argue, since you're both right. Rwaliany is using the actual definition of two's complement (the highest bit represents the opposite of what it does in an unsigned int (so 10000000 = -128 if it's a signed bit and +128 if it's unsigned)). Rbayer is using an easy shortcut to calculating the two's complement.