Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why not just directly get an approximation of the golden ratio by taking fib(n) / fib(n-1)?

If you use an iterative / tail-recursive version you can actually do this directly, without even the overhead of having to calculate it twice.

(I.e. define fib to return a tuple / struct / etc consisting of (fib(n), fib(n-1)).)



> Why not just directly get an approximation of the golden ratio by taking fib(n) / fib(n-1)?

That has been done millions of times over the past 800 odd years. My method has no practical uses, but plenty of educational ones.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: