8000 GH-102341: Improve the test function for pow by ppmfloss · Pull Request #102342 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-102341: Improve the test function for pow #102342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files. 8000
Loading
Diff view
Diff view
Next Next commit
GH-102341: Improve the test function for pow
  • Loading branch information
ppmfloss committed Feb 28, 2023
commit 3bb233dc44ef7eaa31809b12607ba9b2672fe7e0
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