If you stick with the original form of your answer (a recurrance-based one), try Memoizing it, viz.:But the original form of his answer was not recursive:
sub fib{ ($val0, $val1) =@_; $sum= $val0 + $val1; }
In reply to Re^2: Fibonacci Numbers
by blazar
in thread Fibonacci Numbers
by dReKurCe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |