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

Re: [perl #130423] DBL_MAX (and the like) not parsed

Thread Previous | Thread Next
From:
Zefram
Date:
December 29, 2016 05:07
Subject:
Re: [perl #130423] DBL_MAX (and the like) not parsed
Message ID:
20161229050717.GS6507@fysh.org
sisyphus1@optusnet.com.au wrote:
>FWIW, on Windows (perl-5.25.7,  MSWin32-x64-multi-thread) y1 and y2 are the
>same as above, but y3 differs:
...
>y3 =
>179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000

That's fucked up.  Looks like it's libc's fault: sprintf() using a
crap algorithm, converting to decimal with a fixed precision and then
expanding that to the output precision, rather than actually converting
to the output precision.  Arguably we should implement our own float
formatter to avoid this sort of problem.

But anyway, that's unrelated to the input problem with which this ticket
is concerned.  Open a separate ticket if you want to pursue it.

-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