Computing large Fibonacci numbers
The previous post discussed two ways to compute the nth Fibonacci number. The first is to compute all the Fibonacci numbers up to the nth iteratively using the defining property of Fibonacci numbers Fn + 2 = Fn + Fn + 1 with extended integer arithmetic. The second approach is to use Binet’s formula Fn = round( φn / √ 5 ) where φ is the golden ratio. It’s not clear which approach is more efficient. You could say […]