From 0c61ae02299600bef03a658fcaefd0252964c4b8 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Fri, 21 Oct 2016 08:27:47 -0400 Subject: vax-netbsd: Negative zero is only a thing IEEE 754. So don't assume it universal in the signbit emulation. For non-IEEE-754, negative zero is equal to the positive zero. (Another matter is that signbit() should have been found in the Configure scan; it does exist in the netbsd/vax.) --- ext/POSIX/POSIX.xs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index b573f5e1f2..f8288e34a3 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -2636,7 +2636,12 @@ fpclassify(x) #ifdef Perl_signbit RETVAL = Perl_signbit(x); #else - RETVAL = (x < 0) || (x == -0.0); + RETVAL = (x < 0); +#ifdef DOUBLE_IS_IEEE_FORMAT + if (x == -0.0) { + RETVAL = TRUE; + } +#endif #endif break; } -- cgit v1.2.1