mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Merge pull request #4152 from jopemachine/fix-math-pow
Fix edge case of `math.pow(0.0, -inf)`, `math.pow(-0.0, -inf)`
This commit is contained in:
2
Lib/test/test_math.py
vendored
2
Lib/test/test_math.py
vendored
@@ -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)
|
||||
|
||||
@@ -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