(Ben Morrow) wrote: > Quoth jand@activestate.com ("Jan Dubois"): > > On Wed, 28 Jul 2010, Zefram wrote: > > > Jan Dubois wrote: > > > >Well, you _could_ add a special case to the string comparison: > > > > > > That would be a mess. The better solution is for negative zero to > > > stringify as "0". > > But that makes number->string->number round-tripping unreliable, which > was the whole reason for stringifying as "-0" in the first place. Lots > of code assumes that stringification preserves information. Except that "-0" doesn't numify to negative zero. "-0.0" and "-0." do (on darwin-ppc, at least). { print "'$_'\t=> ",$_/1,"\n" foreach qw( -0.0 -0. -0 ); } /Bo LindberghThread Previous | Thread Next