Assuming I have a program with the function
def fakultaet(x):
if x>1:
return(x* fakultaet(x-1))
else:
return(1)
that returns the factorial of a given number, I need to calculate
1.0/fakultaet(200)
but I get an overflow error: long int too large to convert to float.
How can I solve this problem?
You could try this:
Output:
Oh, and also, there is a
factorialfunction in themathmodule already, just includefrom math import factorialat the top of your file to obtain access to it.