From ce35670b0246af244ee918291922bdea03d58c4b Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Thu, 21 Aug 2014 15:04:47 -0400 Subject: [PATCH] Partial revert of c6d2504a: do not use isfinite(). Instead return to a well-defined hack that has served us for years. Immediate reason: VMS. It has isfinite(), but due to messy reasons it doesn't currently get the prototype. --- sv.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sv.c b/sv.c index d295f64..288a1e8 100644 --- a/sv.c +++ b/sv.c @@ -11695,9 +11695,11 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p : SvNV(argsv); need = 0; - /* frexp() has some unspecified behaviour for nan/inf, - * so let's avoid calling that. */ - if (c != 'e' && c != 'E' && Perl_isfinite(nv)) { + /* frexp() (or frexpl) has some unspecified behaviour for + * nan/inf/-inf, so let's avoid calling that on those + * three values. nv * 0 will be NaN for NaN, +Inf and -Inf, + * and 0 for anything else. */ + if (c != 'e' && c != 'E' && (nv * 0) == 0) { i = PERL_INT_MIN; (void)Perl_frexp(nv, &i); if (i == PERL_INT_MIN) -- 1.8.3.1