3 ms·
The "right" way to do Fibonacci is to use matrix multiplication to get the nth Fibonacci number in logarithmic time (google Fibonacci log n matrix).
by Al-Khwarizmi 8y ago
The "right" way to do Fibonacci is to use matrix multiplication to get the nth Fibonacci number in logarithmic time (google Fibonacci log n matrix).
- braythwayt 8y agoA matrix implementatiom in JavaScript: http://raganwald.com/2015/12/20/an-es6-program-to-compute-fibonacci.html http://raganwald.com/2015/12/20/an-es6-program-to-compute-fi... It is based on a Ruby implementation: http://raganwald.com/2008/12/12/fibonacci.html http://raganwald.com/2008/12/12/fibonacci.html