Skip to content

Commit

Permalink
pythonGH-102341: Improve the test function for pow
Browse files Browse the repository at this point in the history
  • Loading branch information
ppmfloss committed Feb 28, 2023
1 parent f300a1f commit 3bb233d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/test/test_pow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ def powtest(self, type):
for othertype in (int,):
for i in list(range(-10, 0)) + list(range(1, 10)):
ii = type(i)
inv = pow(ii, -1) # inverse of ii
for j in range(1, 11):
jj = -othertype(j)
pow(ii, jj)
self.assertAlmostEqual(pow(ii, jj), pow(inv, -jj))

for othertype in int, float:
for i in range(1, 100):
Expand Down

0 comments on commit 3bb233d

Please sign in to comment.