Fix edge case of math.pow(0.0, -inf), math.pow(-0.0, -inf)

This commit is contained in:
Gyubong committed 2022-09-12 12:45:56 +09:00
1 parent fa7a8af735
commit e0f491ea8c
2 files changed
+1 -3

No files matched your search

-2
View File
@@ -1227,8 +1227,6 @@ class MathTests(unittest.TestCase):
self.assertTrue(math.isnan(modf_nan[0]))
self.assertTrue(math.isnan(modf_nan[1]))
# TODO: RUSTPYTHON
@unittest.expectedFailure
def testPow(self):
self.assertRaises(TypeError, math.pow)
self.ftest('pow(0,1)', math.pow(0,1), 0)
+1 -1
View File
@@ -184,7 +184,7 @@ mod math {
return Err(vm.new_value_error("math domain error".to_owned()));
}
if x == 0.0 && y < 0.0 {
if x == 0.0 && y < 0.0 && y != f64::NEG_INFINITY {
return Err(vm.new_value_error("math domain error".to_owned()));
}