TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
This program computes the N^th Fibonacci number in modulo mod input argument . More...
#include <cassert>
#include <cstdint>
#include <iostream>
#include <vector>
Go to the source code of this file.
Functions | |
uint64_t | fibo (uint64_t n, uint64_t mod) |
static void | test () |
int | main () |
This program computes the N^th Fibonacci number in modulo mod input argument .
Takes O(logn) time to compute nth Fibonacci number
Definition in file fibonacci_matrix_exponentiation.cpp.
uint64_t fibo | ( | uint64_t | n, |
uint64_t | mod ) |
This function finds nth fibonacci number in a given modulus
n | nth fibonacci number |
mod | modulo number |
Definition at line 25 of file fibonacci_matrix_exponentiation.cpp.
int main | ( | void | ) |
Main function
Definition at line 108 of file fibonacci_matrix_exponentiation.cpp.
|
static |
Function to test above algorithm
Definition at line 91 of file fibonacci_matrix_exponentiation.cpp.