Find limit of recursion: Difference between revisions
Content added Content deleted
(Nimrod -> Nim) |
(→{{header|PARI/GP}}: limit is the C stack) |
||
Line 1,278: | Line 1,278: | ||
=={{header|PARI/GP}}== |
=={{header|PARI/GP}}== |
||
As per "Recursive functions" in the Pari/GP users's manual. |
|||
From the documentation: |
|||
<lang parigp>dive(n) = dive(n+1) |
<lang parigp>dive(n) = dive(n+1) |
||
dive(0)</lang> |
dive(0)</lang> |
||
The limit is the underlying C language stack. Deep recursion is detected before the stack is completely exhausted (by checking <code>RLIMIT_STACK</code>) so a <code>gp</code> level error is thrown instead of a segfault. |
|||
=={{header|Pascal}}== |
=={{header|Pascal}}== |