Error, too many levels of recursion
Error, (in ...) too many levels of recursion
|
Description
|
|
The too many levels of recursion error occurs when a statement or routine calls itself too many times. For example, a procedure may split a problem, then call itself on a subproblem. Those calls may then split the subproblems still further, and so on. This may cause Maple to run out of memory (stack limit exceeded) or to exceed Maple's internal limit for recursive calls.
|
|
Examples
|
|
>
|
|
| (2.1) |
>
|
|
Solution 1: Set a base case.
>
|
|
| (2.2) |
>
|
|
| (2.3) |
Solution 2: The base case is given within the procedure definition. Here, procname is used to implement the recursive call.
>
|
|
| (2.4) |
>
|
|
| (2.5) |
>
|
|
|
|
Download Help Document
Was this information helpful?