Crate quickfib

Source
Expand description

§Fast fibbonacci algorithm.

This crate provides a fast implementation of the fibbonacci algorithm, no_std compatible. The algorithm is based on the following formula:

F(2n) = F(n) * (2 * F(n+1) - F(n))
F(2n+1) = F(n)^2 + F(n+1)^2

Functions§

fibbonacci
Calculate the n-th fibbonacci number. The function may panic if the type T is not large enough to hold the result.
fibbonacci_range
Calculate the fibbonacci numbers for a range of numbers. The function may panic if the type U is not large enough to hold the result.