Skip to content

Commit e0f491e

Browse files
committed
Fix edge case of math.pow(0.0, -inf), math.pow(-0.0, -inf)
1 parent fa7a8af commit e0f491e

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

Lib/test/test_math.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,6 @@ def testmodf(name, result, expected):
12271227
self.assertTrue(math.isnan(modf_nan[0]))
12281228
self.assertTrue(math.isnan(modf_nan[1]))
12291229

1230-
# TODO: RUSTPYTHON
1231-
@unittest.expectedFailure
12321230
def testPow(self):
12331231
self.assertRaises(TypeError, math.pow)
12341232
self.ftest('pow(0,1)', math.pow(0,1), 0)

stdlib/src/math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ mod math {
184184
return Err(vm.new_value_error("math domain error".to_owned()));
185185
}
186186

187-
if x == 0.0 && y < 0.0 {
187+
if x == 0.0 && y < 0.0 && y != f64::NEG_INFINITY {
188188
return Err(vm.new_value_error("math domain error".to_owned()));
189189
}
190190

0 commit comments

Comments
 (0)