summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/ieee754.txt6
-rw-r--r--Lib/test/test_math.py4
2 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/ieee754.txt b/Lib/test/ieee754.txt
index 89bb0c50a3..a8b8a0a214 100644
--- a/Lib/test/ieee754.txt
+++ b/Lib/test/ieee754.txt
@@ -104,7 +104,7 @@ infinity and NaN.
1.0
The power of 0 raised to x is defined as 0, if x is positive. Negative
-values are a domain error or zero division error and NaN result in a
+finite values are a domain error or zero division error and NaN result in a
silent NaN.
>>> pow(0, 0)
@@ -112,9 +112,7 @@ silent NaN.
>>> pow(0, INF)
0.0
>>> pow(0, -INF)
-Traceback (most recent call last):
-...
-ValueError: math domain error
+inf
>>> 0 ** -1
Traceback (most recent call last):
...
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index da162844e2..42b61c317c 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -1230,7 +1230,7 @@ class MathTests(unittest.TestCase):
self.assertRaises(ValueError, math.pow, 0., -2.)
self.assertRaises(ValueError, math.pow, 0., -2.3)
self.assertRaises(ValueError, math.pow, 0., -3.)
- self.assertRaises(ValueError, math.pow, 0., NINF)
+ self.assertEqual(math.pow(0., NINF), INF)
self.assertTrue(math.isnan(math.pow(0., NAN)))
# pow(INF, x)
@@ -1256,7 +1256,7 @@ class MathTests(unittest.TestCase):
self.assertRaises(ValueError, math.pow, -0., -2.)
self.assertRaises(ValueError, math.pow, -0., -2.3)
self.assertRaises(ValueError, math.pow, -0., -3.)
- self.assertRaises(ValueError, math.pow, -0., NINF)
+ self.assertEqual(math.pow(-0., NINF), INF)
self.assertTrue(math.isnan(math.pow(-0., NAN)))
# pow(NINF, x)