summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-10-21 08:27:47 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2016-10-21 20:13:39 -0400
commit0c61ae02299600bef03a658fcaefd0252964c4b8 (patch)
tree3fbe045d352b111a3a667acc7f0970c1ca36eae5 /ext
parentbd294f6471d5d4f40e13a19a5840352c24d781ef (diff)
downloadperl-0c61ae02299600bef03a658fcaefd0252964c4b8.tar.gz
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.)
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.xs7
1 files changed, 6 insertions, 1 deletions
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;
}