Skip to content

Commit

Permalink
move t999.py out of test/run
Browse files Browse the repository at this point in the history
  • Loading branch information
blacatena committed Feb 25, 2013
1 parent bc01ef9 commit 46b84e3
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/t999.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
print "Big number test"

v=[1,1.0,1L,-1,-1.0,-1L,2,2.0,2L,-2,-2.0,-2L,1e9,-1e9,1e-9,-1e-9,123456789L,12345678901234567890123456789L]
o=['+','-','*','/','**','%','<','=','>','<=','!=','>=']

def oper(v1, v2, op):
if (op == '+'):
print " ",v1,op,v2,"=",v1+v2,type(v1+v2)
elif (op == '-'):
print " ",v1,op,v2,"=",v1-v2,type(v1-v2)
elif (op == '*'):
print " ",v1,op,v2,"=",v1*v2,type(v1*v2)
elif (op == '/'):
print " ",v1,op,v2,"=",v1/v2,type(v1/v2)
elif (op == '**'):
print " ",v1,op,v2,"=",v1**v2,type(v1**v2)
elif (op == '%'):
print " ",v1,op,v2,"=",v1%v2,type(v1%v2)
elif (op == '<'):
print " ",v1,op,v2,"=",v1<v2,type(v1<v2)
elif (op == '='):
print " ",v1,op,v2,"=",v1==v2,type(v1==v2)
elif (op == '>'):
print " ",v1,op,v2,"=",v1>v2,type(v1>v2)
elif (op == '<='):
print " ",v1,op,v2,"=",v1<=v2,type(v1<=v2)
elif (op == '!='):
print " ",v1,op,v2,"=",v1!=v2,type(v1!=v2)
elif (op == '>='):
print " ",v1,op,v2,"=",v1>=v2,type(v1>=v2)

for x in v:
print "Op 1 ::: ",type(x),x

for y in v:
print " Op 2 ::: ",type(y),y
for z in o:
try:
oper(x, y, z)
except:
print "Can't ",type(x),z,type(y)

0 comments on commit 46b84e3

Please sign in to comment.