Skip to content

Commit 6b65bfa

Browse files
committed
* pow: L2979, L2980
1 parent 2d45eb1 commit 6b65bfa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/test/test_math.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,7 @@ def testPow(self):
15641564
self.assertTrue(math.isnan(math.pow(2, NAN)))
15651565
self.assertTrue(math.isnan(math.pow(0, NAN)))
15661566
self.assertEqual(math.pow(1, NAN), 1)
1567+
self.assertRaises(OverflowError, math.pow, 1e+100, 1e+100)
15671568

15681569
# pow(0., x)
15691570
self.assertEqual(math.pow(0., INF), 0.)

Modules/mathmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2969,7 +2969,8 @@ math_pow_impl(PyObject *module, double x, double y)
29692969
(A) (+/-0.)**negative (-> divide-by-zero)
29702970
(B) overflow of x**y with x and y finite
29712971
*/
2972-
else if (Py_IS_INFINITY(r)) {
2972+
else {
2973+
assert(Py_IS_INFINITY(r));
29732974
if (x == 0.)
29742975
errno = EDOM;
29752976
else

0 commit comments

Comments
 (0)