This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d536498
)
infnan: in case NaN is broken by being zero, avoid dividing by it
author
Jarkko Hietaniemi
<jhi@iki.fi>
Wed, 4 Feb 2015 11:48:07 +0000
(06:48 -0500)
committer
Jarkko 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
patch
|
blob
|
blame
|
history
diff --git
a/t/op/infnan.t
b/t/op/infnan.t
index
70f0a7d
..
dc1ff22
100644
(file)
--- a/
t/op/infnan.t
+++ b/
t/op/infnan.t
@@
-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");