mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.12] gh-130230: Add new tests for 3-arg pow() with Decimal (GH-130237) (GH-130247)
(cherry picked from commit b93b7e566e)
This commit is contained in:
parent
0274115585
commit
4a6415cbac
1 changed files with 9 additions and 0 deletions
|
|
@ -4463,6 +4463,15 @@ def test_implicit_context(self):
|
|||
self.assertIs(Decimal("NaN").fma(7, 1).is_nan(), True)
|
||||
# three arg power
|
||||
self.assertEqual(pow(Decimal(10), 2, 7), 2)
|
||||
if self.decimal == C:
|
||||
self.assertEqual(pow(10, Decimal(2), 7), 2)
|
||||
self.assertEqual(pow(10, 2, Decimal(7)), 2)
|
||||
else:
|
||||
# XXX: Three-arg power doesn't use __rpow__.
|
||||
self.assertRaises(TypeError, pow, 10, Decimal(2), 7)
|
||||
# XXX: There is no special method to dispatch on the
|
||||
# third arg of three-arg power.
|
||||
self.assertRaises(TypeError, pow, 10, 2, Decimal(7))
|
||||
# exp
|
||||
self.assertEqual(Decimal("1.01").exp(), 3)
|
||||
# is_normal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue