diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2016-01-26 02:27:49 -0500 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2016-01-28 08:13:29 +0000 |
commit | 3336af0b7f1cd5e0df6884e7476c9355943c4e6b (patch) | |
tree | 70d0e061eb9ed26d9231d2e799d88c3054c5e337 /pp.c | |
parent | 8693e0c5075cb105c408887836410d3f5a02ae0b (diff) | |
download | perl-3336af0b7f1cd5e0df6884e7476c9355943c4e6b.tar.gz |
fix op/infnan.t test fails with NAN conversion on VC 6
fixes
ok 443 - NAN is NaN numerically (by not being NaN)
ok 444 - NAN value stringifies as NaN
ok 445 - nan is NaN numerically (by not being NaN)
not ok 446 - nan value stringifies as NaN
ok 447 - qnan is NaN numerically (by not being NaN)
not ok 448 - qnan value stringifies as NaN
ok 449 - SNAN is NaN numerically (by not being NaN)
not ok 450 - SNAN value stringifies as NaN
ok 451 - NanQ is NaN numerically (by not being NaN)
not ok 452 - NanQ value stringifies as NaN
ok 453 - NANS is NaN numerically (by not being NaN)
not ok 454 - NANS value stringifies as NaN
ok 455 - 1.\#QNAN is NaN numerically (by not being NaN)
not ok 456 - 1.\#QNAN value stringifies as NaN
ok 457 - +1\#SNAN is NaN numerically (by not being NaN)
not ok 458 - +1\#SNAN value stringifies as NaN
ok 459 - -1.\#NAN is NaN numerically (by not being NaN)
not ok 460 - -1.\#NAN value stringifies as NaN
ok 461 - 1\#IND is NaN numerically (by not being NaN)
not ok 462 - 1\#IND value stringifies as NaN
ok 463 - 1.\#IND00 is NaN numerically (by not being NaN)
not ok 464 - 1.\#IND00 value stringifies as NaN
ok 465 - NAN(123) is NaN numerically (by not being NaN)
not ok 466 - NAN(123) value stringifies as NaN
ok 467 - NaN is not lt zero
ok 468 - NaN is not == zero
ok 469 - NaN is not gt zero
ok 470 - NaN is not lt NaN
ok 471 - NaN is not gt NaN
Caused by commit 230ee21f3e from ~5.23.5. Add special casing for VC6.
The NV to IV casts on VC are a function call called __ftol, skip executing
the NV to IV casts if the logic test tests will follow "TARGn" branch
because the NV and IV values are !=.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -1364,9 +1364,14 @@ PP(pp_multiply) NV nr = SvNVX(svr); NV result; - il = (IV)nl; - ir = (IV)nr; - if (nl == (NV)il && nr == (NV)ir) + if ( +#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan) + !Perl_isnan(nl) && nl == (NV)(il = (IV)nl) + && !Perl_isnan(nr) && nr == (NV)(ir = (IV)nr) +#else + nl == (NV)(il = (IV)nl) && nr == (NV)(ir = (IV)nr) +#endif + ) /* nothing was lost by converting to IVs */ goto do_iv; SP--; @@ -1940,9 +1945,14 @@ PP(pp_subtract) NV nl = SvNVX(svl); NV nr = SvNVX(svr); - il = (IV)nl; - ir = (IV)nr; - if (nl == (NV)il && nr == (NV)ir) + if ( +#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan) + !Perl_isnan(nl) && nl == (NV)(il = (IV)nl) + && !Perl_isnan(nr) && nr == (NV)(ir = (IV)nr) +#else + nl == (NV)(il = (IV)nl) && nr == (NV)(ir = (IV)nr) +#endif + ) /* nothing was lost by converting to IVs */ goto do_iv; SP--; |