mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-36027: Extend three-argument pow to negative second argument (GH-13266)
This commit is contained in:
parent
5ae299ac78
commit
c52996785a
6 changed files with 173 additions and 16 deletions
|
@ -1195,7 +1195,8 @@ class BuiltinTest(unittest.TestCase):
|
|||
self.assertAlmostEqual(pow(-1, 0.5), 1j)
|
||||
self.assertAlmostEqual(pow(-1, 1/3), 0.5 + 0.8660254037844386j)
|
||||
|
||||
self.assertRaises(ValueError, pow, -1, -2, 3)
|
||||
# See test_pow for additional tests for three-argument pow.
|
||||
self.assertEqual(pow(-1, -2, 3), 1)
|
||||
self.assertRaises(ValueError, pow, 1, 2, 0)
|
||||
|
||||
self.assertRaises(TypeError, pow)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue