develooper Front page | perl.perl5.porters | Postings from July 2018

[perl #41202] text->float conversion gives wrong answer

Thread Next
From:
sisyphus@cpan.org via RT
Date:
July 16, 2018 05:25
Subject:
[perl #41202] text->float conversion gives wrong answer
Message ID:
rt-4.0.24-14018-1531718720-7.41202-15-0@perl.org
I should probably provide an up-to-date script that checks floating point assignments for correctness.
The one I'm now using is attached as atonv.pl. (Some of my earlier attempts did not handle subnormal values correctly.)

The script requires Math-MPFR-4.03, and that module needs to have been built against mpfr-3.1.6 or later - best to build against the current stable mpfr-4.0.1 if possible.
Running the script as, say, "perl atonv.pl 324 100000" will select a hundred thousand random values in the range 1e-325 to 10e324 and record any that don't assign correctly.

I'd be interested to hear of any mis-assignments that it catches on perls that define $Config{d_strtod} or $Config{d_strtold} && to which the patch under consideration has been applied.

Cheers,
Rob





---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=41202

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