I’m very confused right now, lately I’ve seen a factorial function that I could not possibly believe my eyes.
The code is such simple as:
def fac(n):
if n < 2:
return res
res=1;
res *= fac(n-1)
I thought that this little guy can calculate only to 69! because an average handheld calculator told me that it’s limit turn out this little program’s limit goes beyond that like a lot I tried n=950 and the result was about 3 numbers long.
Can somebody explains why can this happen or it’s just a mess of number showing that the program hits it’s limit.