develooper Front page | perl.perl5.porters | Postings from December 2013

Re: [perl #120426] Strange and unwarranted underflow instring-to-number

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
December 2, 2013 16:35
Subject:
Re: [perl #120426] Strange and unwarranted underflow instring-to-number
Message ID:
20131202163434.GI10295@iabyn.com
On Mon, Dec 02, 2013 at 03:42:59PM +0000, Zefram wrote:
> Dave Mitchell wrote:
> >    I fixed this by stopping the processing of the integer or fractional
> >    component once its been detected that only zeroes are left (with a
> >    suitable adjustment of the exponent).
> 
> Eww.  That won't fix cases where the extra digits are non-zero, such as
> 
> $ echo 0.15301e-305 | perl -e '$v = <STDIN>; print "v=", $v + 0, "\n";'
> v=0
> $ echo 0.15399e-305 | perl -e '$v = <STDIN>; print "v=", $v + 0, "\n";'
> v=0


Oh yeah :-(

I'll need to rethink that.

-- 
Red sky at night - gerroff my land!
Red sky at morning - gerroff my land!
    -- old farmers' sayings #14

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About