Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: useful depth of sub routines

by Laurent_R (Canon)
on May 27, 2013 at 21:33 UTC ( #1035465=note: print w/replies, xml ) Need Help??

in reply to useful depth of sub routines

I do not think that you have to worry too much. unless what you are doing is getting really hairy, you will probably not reach a limit. I have had at least a couple of cases of really complicated nested function calls, but never reached a limit, except of course sometimes for the deeply nested recursive call, but, yet, it is only a warning.

A naive recursive approach to the Fibonacci series can lead to 331 million nested calls of the Fibo function if you want to calculate the 40th Fibonacci number, that is definitely not very time efficient (a few minutes on my computer), but that still works perfectly. I doubt that you will get anywhere near that in a non recursive approach.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1035465]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2018-04-27 05:03 GMT
Find Nodes?
    Voting Booth?