MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / matrix_fibonacci

Function matrix_fibonacci

src/dynamic_programming/fibonacci.rs:135–144  ·  view source on GitHub ↗

matrix_fibonacci(n) returns the nth fibonacci number This function uses the definition of Fibonacci where: F(0) = 0, F(1) = 1 and F(n+1) = F(n) + F(n-1) for n>0 Matrix formula: [F(n + 2)] = [1, 1] * [F(n + 1)] [F(n + 1)] [1, 0] [F(n) ] Warning: This will overflow the 128-bit unsigned integer at n=186

(n: u32)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 2

matrix_powerFunction · 0.85
matrix_multiplyFunction · 0.70

Tested by

no test coverage detected