summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2015-11-30 07:27:47 -0500
committerSteve Hay <steve.m.hay@googlemail.com>2015-12-01 22:46:32 +0000
commitec13a44a401211fa0b922bd171a40c3115f7500a (patch)
tree81fd8c195af59a7b37a3bf01392e7469ecc11bfe
parent9677f0ce70c0d066e562e5e9f4a2e607f90bc0a7 (diff)
downloadperl-ec13a44a401211fa0b922bd171a40c3115f7500a.tar.gz
hexfp: signbit() works on NVs (nv), not on long doubles (fv).
The nv value should be a valid version of the fv value. Why the fv is a long double, not a NV, is a long (haha) story. Short version: the printf code expects to be able to work with long doubles, if long doubles are available, even without -Duselongdouble. The problem became obvious in VMS which has true 128-bit long (little-endian) doubles, and trying the signbit() on those did not work. (cherry picked from commit 50006c82290de7fc1fd3bbb5e4d893723659dd82)
-rw-r--r--sv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 0a46ebcd5a..263d27bedc 100644
--- a/sv.c
+++ b/sv.c
@@ -12332,7 +12332,7 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
#endif
if (fv < 0
- || Perl_signbit(fv)
+ || Perl_signbit(nv)
)
*p++ = '-';
else if (plus)