Long int too large to convert?

fbasegmez fb at ultranet.com
Wed Sep 12 22:06:09 CEST 2001


Howdy,

I got this error message and not sure what it means?

>>> for i in xrange(1L, 5 * pow(10L, 40)):
... 	x = i * x
... 	
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
OverflowError: long int too large to convert
>>> 

Any ideas?

Fahri

p.s. 
First I was going to use scientific notation instead of pow(x, y) but
then I decided not to because,
>>> long(5e40)
50000000000000000310004322520389159747584L
>>>
I am aware of numerical precision issues but this still managed to
surprise me.



More information about the Python-list mailing list