summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-11-13 18:49:47 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2014-11-14 19:01:53 -0500
commit2a7bb1640b6b68e85e290f8c873f75ec0a150d23 (patch)
tree58fccb27737189f52e7b50cb621736714d76aaff /ext
parent1f606f8c79f766d79c95369de35db666df8fbb51 (diff)
downloadperl-2a7bb1640b6b68e85e290f8c873f75ec0a150d23.tar.gz
Emulate signbit() if necessary.
Diffstat (limited to 'ext')
-rw-r--r--ext/POSIX/POSIX.xs2
-rw-r--r--ext/POSIX/t/math.t3
2 files changed, 2 insertions, 3 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 930b83516a..923b3d3400 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -2278,6 +2278,8 @@ fpclassify(x)
default:
#ifdef Perl_signbit
RETVAL = Perl_signbit(x);
+#else
+ RETVAL = (x < 0) || (x == -0.0);
#endif
break;
}
diff --git a/ext/POSIX/t/math.t b/ext/POSIX/t/math.t
index c3232c15af..8a15d7734c 100644
--- a/ext/POSIX/t/math.t
+++ b/ext/POSIX/t/math.t
@@ -117,9 +117,6 @@ SKIP: {
cmp_ok(abs(log1p(1e-6) - 9.99999500000333e-07), '<', 1e-9, "log1p");
cmp_ok(abs(log2(8) - 3), '<', 1e-9, "log2");
SKIP: {
- unless ($Config{d_signbit}) {
- skip "no signbit", 2;
- }
is(signbit(2), 0, "signbit 2"); # zero
ok(signbit(-2), "signbit -2"); # non-zero
}