Long int too large to convert?

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


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?


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

More information about the Python-list mailing list