mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix edge case of math.pow(0.0, -inf), math.pow(-0.0, -inf)
This commit is contained in:
1 parent
fa7a8af735
commit
e0f491ea8c
2 files changed
+1
-3
No files matched your search
Vendored
-2
@@ -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
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user