summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Ragwitz <rafl@debian.org>2010-10-11 06:30:41 +0200
committerFlorian Ragwitz <rafl@debian.org>2010-10-11 06:30:41 +0200
commit7e7b870751068e26e2d984893c5d24689c41ab01 (patch)
treedf34681e118f91bfe653d6553f9259228635453e
parenta88d97bfe873ee5c93f51531b75b464dbf1c0222 (diff)
downloadperl-smoke-me/nan_inf_str.tar.gz
Add tests for stringifying NaN and Infsmoke-me/nan_inf_str
-rw-r--r--t/base/num.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/base/num.t b/t/base/num.t
index fbeddc9434..a2b084fa10 100644
--- a/t/base/num.t
+++ b/t/base/num.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..53\n";
+print "1..57\n";
# First test whether the number stringification works okay.
# (Testing with == would exercize the IV/NV part, not the PV.)
@@ -209,3 +209,17 @@ print $a eq "16702650" ? "ok 52\n" : "not ok 52 # $a\n";
$a = 0B1101; "$a";
print $a eq "13" ? "ok 53\n" : "not ok 53 # $a\n";
+
+# NaN and Inf
+
+$a = 9 ** 9 ** 9; "$a";
+print $a eq "inf" ? "ok 54\n" : "not ok 54 # $a\n";
+
+$a = -9 ** 9 ** 9; "$a";
+print $a eq "-inf" ? "ok 55\n" : "not ok 55 # $a\n";
+
+$a = -sin 9 ** 9 ** 9; "$a";
+print $a eq "nan" ? "ok 56\n" : "not ok 56 # $a\n";
+
+$a = sin 9 ** 9 ** 9; "$a";
+print $a eq "-nan" ? "ok 57\n" : "not ok 57 # $a\n";