David Steinberg
10 years ago
committed by
Damien George
4 changed files with 109 additions and 7 deletions
@ -1,10 +1,24 @@ |
|||
# This case occurs with time.time() values |
|||
print(int(1418774543.)) |
|||
|
|||
# TODO: General case with large exponent |
|||
#print(int(2.**100)) |
|||
print(int(2.**100)) |
|||
|
|||
print("%d" % 1418774543.) |
|||
|
|||
# TODO: General case with large exponent |
|||
#print("%d" % 2.**100) |
|||
print("%d" % 2.**100) |
|||
|
|||
testpass = True |
|||
for i in range(0,1024): |
|||
bitcnt = len(bin(int(2.**i))) - 3; |
|||
if i != bitcnt: |
|||
print('fail: 2**%u was %u bits long' % (i, bitcnt)); |
|||
testpass = False |
|||
print("power of 2 test: %s" % (testpass and 'passed' or 'failed')) |
|||
|
|||
testpass = True |
|||
for i in range(0,23): |
|||
digcnt = len(str(int(10.**i))) - 1; |
|||
if i != digcnt: |
|||
print('fail: 10**%u was %u digits long' % (i, digcnt)); |
|||
testpass = False |
|||
print("power of 10 test: %s" % (testpass and 'passed' or 'failed')) |
|||
|
Loading…
Reference in new issue