On a sign-magnitude C implementation, ~~INT_MAX==INT_MIN. In particular, ~~ is not the identity.
-
-
The above is a hidden consequence of 6.2.6.1 ¶ 8.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
can you explain ~~INT_MAX==INT_MIN?
-
~ is defined bitwise, so ~INT_MAX is "negative 0". But 6.2.6.1¶8 requires all operators to behave same on 0 and "-0".
-
Thus ~~INT_MAX = ~NEG_ZERO = ~0 = all one bits = -INT_MAX = INT_MIN.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.