On Thu, Jul 29, 2010 at 08:18:11PM +0200, Bo Lindbergh wrote: > (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 ); > } > > It does for me (linux-i686). $ perl print "'$_'\t=> ",$_/1,"\n" foreach qw( -0.0 -0. -0 ); ^D '-0.0' => -0 '-0.' => -0 '-0' => -0 $ AbigailThread Previous | Thread Next