UNPKG

@santi100/binet-formula

Version:

Santi's Basic Binet Formula Library: What is F_n?

14 lines (13 loc) 555 B
/** * Calculates the Fibonacci number at the given position using Binet's Formula. * * Binet's Formula is an efficient way to calculate Fibonacci numbers using the golden ratio. * * **Keep in mind this function may be prone to floating-point JavaScript imprecision.** * * @param n The positive integer position in the Fibonacci sequence to look for. * @throws A `TypeError` if `n` is not a number, negative, or not an integer. * @returns The Fibonacci number at position `n`. */ declare const _default: (n: number) => number; export = _default;