Re: x == 0 && (x & -1) != 0 for negative zero?



iRo <xyx@xxxxxxxxx> writes:
In data Wed, 19 Sep 2007 16:49:08 +0000 (UTC), $)CHarald van D)&k
<truedfx@xxxxxxxxx> scrisse:
[...]
Negative zero doesn't exist in 2's complement. And the only forms -0 can
take are:

0x0000 2's complement
0x0000 1s' complement
0x0000 sign/magnitude.

since -0 is not negative zero regardless of representation.

pheraps: unsigned i=0; --i;

I'm not sure what you're trying to say here. The above decrements i,
setting it to UINT_MAX.

so it should be "--0" and not "-0"

--0 is illegal, since "--" is a single token. Did you mean to apply
unary '-' twice? If so, you can write it as '- -0', or as '-(-0)'
(or, equivalently, just as 0).

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.