From d22fb6ca0a489331fea369e4ab9a5d4013de1bb0 Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Tue, 19 May 2015 13:22:40 -0400 Subject: 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 --- pp_pack.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pp_pack.c') diff --git a/pp_pack.c b/pp_pack.c index 1d732a8bf7..cf1074e23d 100644 --- a/pp_pack.c +++ b/pp_pack.c @@ -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 : -- cgit v1.2.1