diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2015-05-19 13:22:40 -0400 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2015-05-20 20:37:58 -0400 |
commit | d22fb6ca0a489331fea369e4ab9a5d4013de1bb0 (patch) | |
tree | 1ed78b4089676747256924ed8ac6ce90cb813559 /pp_pack.c | |
parent | 3b50e657ec7db1b772838d00793c724c0e61382a (diff) | |
download | perl-d22fb6ca0a489331fea369e4ab9a5d4013de1bb0.tar.gz |
pack('f', $NAN) must account for NAN_COMPARE_BROKEN platforms
VC6 was returning either packed float +inf or packed float -inf
(I dont remember) instead of packed float NAN in t/op/infnan.t .
This fixes #125203
Diffstat (limited to 'pp_pack.c')
-rw-r--r-- | pp_pack.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -2672,6 +2672,11 @@ S_pack_rec(pTHX_ SV *cat, tempsym_t* symptr, SV **beglist, SV **endlist ) afloat = -FLT_MAX; else afloat = (float)anv; # else +#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan) + if(Perl_isnan(anv)) + afloat = (float)NV_NAN; + else +#endif /* a simple cast to float is undefined if outside * the range of values that can be represented */ afloat = (float)(anv > FLT_MAX ? NV_INF : |