Forum Discussion
Lambda Example: Generate Fibonacci series
In case of FIB() - yes, maybe, but the question is more general. How to find the compromise with error handling within lambdas which definitely could reduce the performance. Keep #VALUE! and #N/A as in native functions or add error handling and when. Decision is on case by case basis, I don't see common rule.
Another side effect is rounding which could give an error only on some inner iteration if use recursion, probably it will be bit hard to debug in some cases.
There may be a better solution but one approach I can think about handling error would be to have Lambda in two layers.
I am just putting the pseudo code here,
MAIN
=Lambda(n, IF(n<>int(n),"Enter integer",FIB(n)))
FIB
=Lambda(n, ..................)
I am new to recursive programming. So, I am not sure if this is the only solution. Perhaps better option exists.