bnmnetp/skulpt — pull request #24 by blacatena (2012-06-09 22:59:26+00:00)
Title: Bignumber

New logic for long. Test all cases, make up some of your own, and try this program (try different values, too):

a=123456789012345678901234567890L
b=1234567890L
c=98766549816687373531138542522L

print "a",a
print "b",b
print "c",c

print "Mode:"
print long_div_mode()
print "a / b = ",(a / b),type(a/b)
print "a / c = ",(a / c),type(a/c)
print "a / a = ",(a / a),type(a/a)
print "a // c = ",(a // c),type(a//c)
print "a % c = ",(a % c),type(a%c)

print "Mode:"
print long_div_mode('float')
print "a / b = ",(a / b),type(a/b)
print "a / c = ",(a / c),type(a/c)
print "a / a = ",(a / a),type(a/a)
print "a // c = ",(a // c),type(a//c)
print "a % c = ",(a % c),type(a%c)

print "Mode:"
print long_div_mode('variable')
print "a / b = ",(a / b),type(a/b)
print "a / c = ",(a / c),type(a/c)
print "a / a = ",(a / a),type(a/a)
print "a // c = ",(a // c),type(a//c)
print "a % c = ",(a % c),type(a%c)