Find limit of recursion: Difference between revisions
Content added Content deleted
(C) |
m (→{{header|C}}) |
||
Line 83: | Line 83: | ||
}</lang> |
}</lang> |
||
Segmentation fault occurs when i is 523756. (This was checked debugging with gdb rather than waiting the output: the printf line for the test was commented). It must be noted that the recursion limit depends on how many parameters are passed onto the stack. E.g. adding a fake double argument to <code>recurse</code>, the limit is reached at <code>i == 261803</code>. The limit depends on the stack size. |
Segmentation fault occurs when i is 523756. (This was checked debugging with gdb rather than waiting the output: the printf line for the test was commented). It must be noted that the recursion limit depends on how many parameters are passed onto the stack. E.g. adding a fake double argument to <code>recurse</code>, the limit is reached at <code>i == 261803</code>. The limit depends on the stack size; so if each call to the function uses more stack space, the recursion limit becomes smaller. |
||
=={{header|Python}}== |
=={{header|Python}}== |