We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7894bbe commit 3222054Copy full SHA for 3222054
Lib/test/test_pow.py
@@ -19,12 +19,11 @@ def powtest(self, type):
19
self.assertEqual(pow(2, i), pow2)
20
if i != 30 : pow2 = pow2*2
21
22
- for othertype in (int,):
23
- for i in list(range(-10, 0)) + list(range(1, 10)):
24
- ii = type(i)
25
- for j in range(1, 11):
26
- jj = -othertype(j)
27
- pow(ii, jj)
+ for i in list(range(-10, 0)) + list(range(1, 10)):
+ ii = type(i)
+ inv = pow(ii, -1) # inverse of ii
+ for jj in range(-10, 0):
+ self.assertAlmostEqual(pow(ii, jj), pow(inv, -jj))
28
29
for othertype in int, float:
30
for i in range(1, 100):
0 commit comments