Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Fri, 21 Sep 2007 12:14:48 -0700
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"
.
- References:
- x == 0 && (x & -1) != 0 for negative zero?
- From: Hallvard B Furuseth
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Hallvard B Furuseth
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Ark Khasin
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Hallvard B Furuseth
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Ark Khasin
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Hallvard B Furuseth
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Charlie Gordon
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: Hallvard B Furuseth
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: CBFalconer
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: $)CHarald van D)&k
- Re: x == 0 && (x & -1) != 0 for negative zero?
- From: iRo
- x == 0 && (x & -1) != 0 for negative zero?
- Prev by Date: Re: facing problem during compilation
- Next by Date: Re: comparison between signed and unsigned int
- Previous by thread: Re: x == 0 && (x & -1) != 0 for negative zero?
- Next by thread: Re: x == 0 && (x & -1) != 0 for negative zero?
- Index(es):