summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_math.py')
-rw-r--r--Lib/test/test_math.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 12e7f98..90bd363 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -915,6 +915,15 @@ class MathTests(unittest.TestCase):
self.assertRaises(TypeError, math.trunc, 1, 2)
self.assertRaises(TypeError, math.trunc, TestNoTrunc())
+ def testIsfinite(self):
+ self.assertTrue(math.isfinite(0.0))
+ self.assertTrue(math.isfinite(-0.0))
+ self.assertTrue(math.isfinite(1.0))
+ self.assertTrue(math.isfinite(-1.0))
+ self.assertFalse(math.isfinite(float("nan")))
+ self.assertFalse(math.isfinite(float("inf")))
+ self.assertFalse(math.isfinite(float("-inf")))
+
def testIsnan(self):
self.assertTrue(math.isnan(float("nan")))
self.assertTrue(math.isnan(float("inf")* 0.))