Commit d3ba7557 authored by Boxiang Sun's avatar Boxiang Sun

add more tests for pow into float.py and long.py

parent ff530a0a
......@@ -95,3 +95,12 @@ print -(0.0)
print -(-0.0)
print repr((1e100).__trunc__())
all_args = [None, 1, 1L, -1, -1L, 2.0, 0.5, 0]
for lhs in all_args:
for rhs in all_args:
for mod in all_args:
try:
print pow(lhs, rhs, mod)
except Exception as e:
print type(e), e
......@@ -57,6 +57,10 @@ print ~(-10L)
print -(1L)
print 1L**2L
print 1L**2
print 0 ** (1 << 100)
print pow(1 << 30, 1 << 30, 127)
print pow(1L << 30, 1L << 30, 127)
print pow(1 << 100, 1 << 100, 1000)
print (11L).__pow__(32, 50L)
print (11L).__index__()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment