I have this function defined:
def nichtrest(n):
return 0.9 * n**(1/4) * math.log(n)
I want to calculate this for some large numbers, e.g. n = (2 ^ 5001+1) * 2 ^ 10000 + 1.
Then I get "int too large to convert to float".
But I can run this code:
h = 2**51+1
k = 1000
n = h*2**k+1
print( n> 1)
And it says "true". So it can handle the large number n. I tried to round it down but I get the same error.
As @Giacomo Catenazzi already mentioned, floating point numbers have a maximum value that you violate, this happens when you convert the integer to a float, by round, cast ...
See here the system information about float:
For the int type, see this post: Maximum and Minimum values for ints
Also the conversion to string has a limit (by print()):
Last but not least:
The dot behind the integer generates a cast to float: