This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
infnan: in case NaN is broken by being zero, avoid dividing by it
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 4 Feb 2015 11:48:07 +0000 (06:48 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 4 Feb 2015 11:57:15 +0000 (06:57 -0500)
So that the test doesn't die too early.

t/op/infnan.t

index 70f0a7d..dc1ff22 100644 (file)
@@ -292,7 +292,12 @@ is($NaN * 2, $NaN, "twice NaN is NaN");
 is($NaN / 2, $NaN, "half of NaN is NaN");
 
 is($NaN * $NaN, $NaN, "NaN * NaN is NaN");
-is($NaN / $NaN, $NaN, "NaN / NaN is NaN");
+SKIP: {
+    if ($NaN == 0) {
+        skip "NaN looks like zero, avoiding dividing by it", 1;
+    }
+    is($NaN / $NaN, $NaN, "NaN / NaN is NaN");
+}
 
 for my $f (@printf_fmt) {
     is(sprintf("%$f", $NaN), "NaN", "$NaN sprintf %$f is NaN");