On Wed, 28 Jul 2010, Chas. Owens wrote: > On Wed, Jul 28, 2010 at 11:58, Nicholas Clark <nick@ccl4.org> wrote: > > And if you're really up for it, there's a bug with no obvious fix if your > > system supports negative zero: > > > > $ perl -wle '$a = 0/-1; print $a ? "T" : "F"; print $a; print $a ? "T" : "F";' > > F > > -0 > > T > snip > > That only happens on one's complement machines right? Are there any > one's complement machines left? No, it happens (at least) for all machines with IEEE 754 floating point. There is no -0 integer, as you correctly point out, but there is a -0. float. Just run Nicholas' oneliner on any x86/x64 chip to see that it does what he said it does... Cheers, -JanThread Previous | Thread Next