summaryrefslogtreecommitdiff
path: root/ext/POSIX
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2016-10-21 08:44:04 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2016-10-21 20:13:40 -0400
commit3abfcf99a04030f74a31ef77ae4c2563c046ea99 (patch)
tree1f6e37c1027a32cfd6f96d43a6824e9982c7809e /ext/POSIX
parent9ec6051125f905d725726b79ce9b4ad491cea421 (diff)
downloadperl-3abfcf99a04030f74a31ef77ae4c2563c046ea99.tar.gz
vax-netbsd: test non-IEEE-754-ness only once
Diffstat (limited to 'ext/POSIX')
-rw-r--r--ext/POSIX/t/math.t21
1 files changed, 9 insertions, 12 deletions
diff --git a/ext/POSIX/t/math.t b/ext/POSIX/t/math.t
index 5765ead439..adb5de524e 100644
--- a/ext/POSIX/t/math.t
+++ b/ext/POSIX/t/math.t
@@ -55,13 +55,15 @@ between(0.76, tanh(1), 0.77, 'tanh(1)');
between(-0.77, tanh(-1), -0.76, 'tanh(-1)');
cmp_ok(tanh(1), '==', -tanh(-1), 'tanh(1) == -tanh(-1)');
+my $non_ieee_fp = ($Config{doublekind} == 9 ||
+ $Config{doublekind} == 10 ||
+ $Config{doublekind} == 11);
+
SKIP: {
skip "no fpclassify", 4 unless $Config{d_fpclassify};
is(fpclassify(1), FP_NORMAL, "fpclassify 1");
is(fpclassify(0), FP_ZERO, "fpclassify 0");
- skip("no inf/nan", 2) if ($Config{doublekind} == 9 ||
- $Config{doublekind} == 10 ||
- $Config{doublekind} == 11);
+ skip("no inf/nan", 2) if $non_ieee_fp;
is(fpclassify(INFINITY), FP_INFINITE, "fpclassify INFINITY");
is(fpclassify(NAN), FP_NAN, "fpclassify NAN");
}
@@ -102,9 +104,7 @@ SKIP: {
ok(!isinf(42), "isinf 42");
ok(!isnan(42), "isnan Inf");
SKIP: {
- skip("no inf/nan", 9) if ($Config{doublekind} == 9 ||
- $Config{doublekind} == 10 ||
- $Config{doublekind} == 11);
+ skip("no inf/nan", 9) if $non_ieee_fp;
ok(!isfinite(Inf), "isfinite Inf");
ok(!isfinite(NaN), "isfinite NaN");
ok(isinf(INFINITY), "isinf INFINITY");
@@ -147,9 +147,7 @@ SKIP: {
ok(islessequal(1, 1), "islessequal 1 1");
SKIP: {
- skip("no inf/nan", 2) if ($Config{doublekind} == 9 ||
- $Config{doublekind} == 10 ||
- $Config{doublekind} == 11);
+ skip("no inf/nan", 2) if $non_ieee_fp;
ok(!isless(1, NaN), "isless 1 NaN");
ok(isunordered(1, NaN), "isunordered 1 NaN");
}
@@ -171,9 +169,8 @@ SKIP: {
near(lgamma(9), 10.6046029027452, "lgamma 9", 1.5e-7);
SKIP: {
- skip("no inf/nan", 19) if ($Config{doublekind} == 9 ||
- $Config{doublekind} == 10 ||
- $Config{doublekind} == 11);
+ skip("no inf/nan", 19) if $non_ieee_fp;
+
# These don't work on old mips/hppa platforms
# because nan with payload zero == Inf (or == -Inf).
# ok(isnan(setpayload(0)), "setpayload zero");