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

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

Thread Previous | Thread Next
From:
sisyphus@cpan.org via RT
Date:
July 16, 2018 04:56
Subject:
[perl #41202] text->float conversion gives wrong answer
Message ID:
rt-4.0.24-14019-1531716964-926.41202-15-0@perl.org
On Sun, 15 Jul 2018 06:14:33 -0700, jkeenan wrote:
 
> On Linux, I got a lot of failures in 3 files:
> 
> #####
> re/uniprops02.t
> (Wstat: 65280 Tests: 33506 Failed: 302)
>   Failed tests:  22498-22499, 22501, 22503, 22570, 26098
>                 26129-26136, 26202, 26274, 26312, 26346
>                 26348, 26350, 26352, 26418, 26420, 26422
>                 26424, 26439, 26490, 26492, 26494, 26496
>                 26532, 26561-26568, 26582, 26597, 26599
>                 26601, 26603, 26621, 26634, 26636, 26638-26640
>                 26706, 26708-26710, 26712, 26741, 26764
>                 26777-26784, 27272-27273, 27306, 27308
>                 27310, 27312, 27378, 27380, 27382, 27384
>                 27649-27656, 27686-27687, 27689, 27691
>                 27722, 27724, 27726, 27728, 27994, 28035
>                 28066, 28306, 28338, 28379-28380, 28410
>                 28446, 28463-28470, 28482, 28484, 28486
>                 28488, 28962, 29010, 29012, 29014-29016
>                 29028, 29081, 29154, 29226, 29228, 29230
>                 29232, 29268, 29297-29298, 29300, 29302
>                 29304, 29334, 29336, 29370, 29372, 29374
>                 29376, 29411, 29427, 29442, 29444, 29446
>                 29448, 29481, 29483, 29514, 29555-29556
>                 29585-29588, 29590, 29592, 29623-29624
>                 29641, 29658, 29660, 29662, 29664, 29697
>                 29730, 29765, 29771, 29783, 29802, 29804
>                 29806-29808, 29840, 29842, 29844, 29857
>                 29873-29874, 29876, 29878, 29880, 29933
>                 29945, 29981, 29984-29985, 30005, 30017-30018
>                 30020, 30022, 30024, 30042, 30090, 30092
>                 30094, 30096, 31810, 31882, 31935, 31954
>                 31989, 31993, 32025-32026, 32028, 32030
>                 32032, 32084, 32098, 32100-32102, 32104
>                 32170, 32172, 32174, 32176, 32242, 32244
>                 32246, 32248, 32314, 32386, 32458, 32460-32462
>                 32464, 32494-32495, 32497, 32499, 32530
>                 32532, 32534, 32536, 32565-32566, 32601
>                 32674, 32710, 32728, 32746-32748, 32750
>                 32752, 32800, 32818-32820, 32822, 32824
>                 33053, 33060, 33089-33090, 33092-33094
>                 33096, 33161-33166, 33168, 33183, 33203
>                 33233-33240, 33287, 33306-33308, 33310
>                 33312, 33342, 33346, 33378-33380, 33382
>                 33384, 33413-33414, 33416, 33418, 33420
>                 33450, 33452, 33454, 33456, 33486, 33491
>   Non-zero exit status: 255
> re/uniprops03.t
> (Wstat: 65280 Tests: 33346 Failed: 113)
>   Failed tests:  196, 198, 200, 202, 268-269, 345, 559, 1647-1648
>                 2006, 2080, 2149, 2152, 2224-2225, 2291
>                 2293-2294, 3212-3215, 3358, 3392, 3432
>                 3445, 3464, 3536, 3538, 3540, 3542, 3556
>                 3608, 3680, 3682, 3684, 3686, 3751-3752
>                 3754, 3756, 3758, 3774, 3791, 3824-3826
>                 3828, 3830, 3846, 3860, 3862-3864, 3866
>                 3896, 3898, 3900, 3902, 3936, 3938, 3968
>                 3970, 3972, 3974, 4007-4009, 4040, 4042
>                 4044, 4046, 4282, 4312, 4314-4316, 4318
>                 4348, 4384, 4386, 4388, 4390, 4421-4422
>                 4456, 4458-4462, 4493, 4509-4516, 4528
>                 4530, 4532-4534, 4548, 4564, 4568, 4600
>                 4602, 4604, 4606
>   Non-zero exit status: 255
> ../lib/locale.t
> (Wstat: 0 Tests: 682 Failed: 5)
>   Failed tests:  427-428, 432, 435, 449
> Files=2661, Tests=1165509, 264 wallclock secs (88.37 usr 10.40 sys +
> 536.50 cusr 29.09 csys = 664.36 CPU)
> Result: FAIL
> makefile:844: recipe for target 'test_harness' failed
> #####
> 
> branch: smoke-me/jkeenan/sisyphus/41202-text-float

That looks similar to what I got, except I didn't notice any locale.t.
Things are much better now, at blead commit 6d37e916c310482d19ce4cd94848823cad43507a.

The numeric.c patch that I have (against the numeric.c at that commit) is attached as 0002-patched-numeric.c.patch.
Let me know if you want a patch against a different stage of numeric.c.

All is working fine for me again - and I hope you see the same improvement.

Note that -Dusequadmath builds of perl should be identical, irrespective of whether this patch is applied. This is most desirable because quadmath builds already assign floating point values correctly, straight out of the box.
It's only the "double" and "long double" builds that can benefit from this patch - and then only if Perl_strtod is defined.

Having applied the patch, if you then build perl configured with -Ud_strtod (on a "double" build) or -Ud_strtold (on a "long double" build) then you should effectively disable the patch. (This can be useful for comparison purposes.)

Cheers,
Rob

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

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