This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Amend change 31854 for when NAN_COMPARE_BROKEN
[perl5.git] / sv.c
diff --git a/sv.c b/sv.c
index a2646f7..1933945 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -9194,7 +9194,12 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
                : SvNV(argsv);
 
            need = 0;
-           if (c != 'e' && c != 'E' && nv == nv) {
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+           if (c != 'e' && c != 'E' && !Perl_isnan(nv))
+#else
+           if (c != 'e' && c != 'E' && nv == nv)
+#endif
+           {
                i = PERL_INT_MIN;
                /* FIXME: if HAS_LONG_DOUBLE but not USE_LONG_DOUBLE this
                   will cast our (long double) to (double) */