The number 8e10000000
is not an integer, it is a floating point number to Python. Any number using the e
notation is treated as a float. Python uses (usually) a 64-bit float format, and that cannot hold such a large number.
So the problem is not the integer, it is the float you start with. The error is not at the line number = int(n)
, it is at the line n = 8e10000000
or whatever equivalent you used.
You can avoid that error by using
n = 8 * 10**10000000
This results in an integer. But be careful--that takes a lot of time and memory to build the integer in RAM. (My system took 19 seconds to execute that one command.) And if you try to print that value, the computer will take a very long time and a large amount of memory to build up the string value to be printed.
Finally, as others have pointed out, that statement that you claim does not match the error message. So it is possible that something else is going on. If you want closure from us, show an entire code snippet that shows that error.