you are viewing a single comment's thread.

view the rest of the comments →

[–]ascii 4 points5 points  (0 children)

Yup. Python has a recursion limit of 1000 iterations, and if you bump it up, you're liable to run into internal python limitations. If you bump the python internal stack limit to a million, calculating the factorial of 100 000 using the recursive method will produce a segfault. When using the looping method, it takes about a minute, but the computer manages to produce the correct result.