Assuming I have a program with the function
def fakultaet(x):
if x>1:
return(x* fakultaet(x-1))
else:
return(1)
tha
You could try this:
from decimal import Decimal
def fakultaet(x): # as you have it currently
if x>1:
return(x * fakultaet(x-1))
else:
return(1)
print Decimal(1.0) / fakultaet(200)
Output:
1.267976953480962421753016371E-375
Oh, and also, there is a factorial
function in the math
module already, just include from math import factorial
at the top of your file to obtain access to it.