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:
Zefram
Date:
December 2, 2013 15:43
Subject:
Re: [perl #120426] Strange and unwarranted underflow instring-to-number
Message ID:
20131202154259.GU21945@fysh.org
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

-zefram

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