Is there a way to get python to print extremely large longs in scientific notation? I am talking about numbers on the order of 10^1000 or larger, at this size the standard print
Try this:
>>> def scientific_notation(v): # Note that v should be a string for eval()
d = Decimal(eval(v))
e = format(d, '.6e')
a = e.split('e')
b = a[0].replace('0','')
return b + 'e' + a[1]
>>> scientific_notation('10**1000')
'1.e+1000'
>>> scientific_notation('10**1000')
'1.e+1000'
>>> sc('108007135253151**1000') # Even handles large numbers
'2.83439e+14033'