Re:Issues with porting C++ code to a 64-bit platform
by xentronium on Monday April 01, 2013 @04:06PM
(#5475545)
This is a technicality. Leftmost bit still denotes a sign and modulo of the number is still capped at n-1 bits.
[ Parent
| on HN ]
Re:Issues with porting C++ code to a 64-bit platform
by MichaelSalib on Monday April 01, 2013 @04:33PM
(#5475728)
The differences between the representations matter. In 2s complement, -INT_MIN is not INT_MAX; in fact, -INT_MIN is undefined and a C compiler is justified in deleting all your code if you ever cause it to calculate -INT_MIN.
I tell you what: if you think modern architectures use an explicit sign bit to represent integers, how do you explain the fact that INT_MAX+1==-INT_MIN? If there's a sign bit, how could you possibly represent more negative integers than positive integers?