-a
for the case of a == 0
is well defined. What the standard requires is that it's still zero.
It does not guarantee that the "bits" in the value are unchanged (they are for two's complement, but not for ones complement, in which case the value is "negative zero", whatever the bit pattern of that is). But the value should be true for if (!x)
or if (x == 0)
, even if x
has the value "negative zero" - it's up to the compiler and/or processor manufacturer to make sure that works.