I have created a simple recursive factorial function in Python. Currently, my computer can calculate factorials up to approximately 10000. For values higher than that, python.exe just stops working.
So, my question is this: if I want to handle larger factorials, is there any way I can do this (by using multiple cores, etc)? Or is it just Python's limit? I've checked out using the GPU for Python scripts, but the method seems to complicated + convoluted for what I have in mind.
I have set the recursion limit to 100000, so that shouldn't be the issue.
This is my code:
import sys, time
sys.setrecursionlimit(100000)
def f(n):
if n==0:
return 1
else:
return n*f1(n-1)
Thank you for your help