Talk:Fibonacci sequence: Difference between revisions

m
correct typo of ''amd'' ---> ''and''. -- ~~~~
(added a comment concerning concern for speed. -- ~~~~)
m (correct typo of ''amd'' ---> ''and''. -- ~~~~)
Line 5:
while the parenthetical comment is true, I'm wondering what to make of it. Is there any application of FIbonacci numbers where "computation time" is actually an issue? Do we care about computation time at all? If we do, I'd use neither an iterative nor a recursive approach but an analytic solution through phi (I added that to IDL, I see from a glance that at least the D solution has one of these as well).
 
: Just for this <tt> RC </tt> task, speed shouldn't be an issue. As an aside, it would irk me to no end if I included an example that's slower than molassas in January. But many programmers who reuse (their) code amdand/or "borrow" code from others, and if there is a need to generate large amounts of Fibonacci numbers (or often)., or test to see if some number ''is'' a Fibonacci number, then having a very fast version would be beneficial for those processes. I have one for my '''isFib''' function, for instance. -- [[User:Gerard Schildberger|Gerard Schildberger]] 22:51, 29 May 2012 (UTC)
 
I guess my question is: if we care about speed, why demand that the solution be iterative or recursive? Or, more generally, if performance is a concern, why demand any particular approach at all -- since the "best" approach for any one task is bound to be different for different languages. (Something with decent tail recursion might have recursive solutions faster than iterative ones and what-have-you).