This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The Fibonacci numbers in JavaScript. | |
* | |
* A cached solution with O(1) lookup for previously-calculated terms and O(N) | |
* lookup for uncalculated ones. | |
* | |
* Because numbers in JavaScript are 64bit, the largest available number is | |
* 1.7976931348623157e+308. The 1476th term is the last that can be calculated. | |
* If a later term is requested, the function will return Infinity. | |
* |