|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
n-th Fibonacci number. More...
#include <cassert>#include <iostream>Namespaces | |
| namespace | math |
| for IO operations | |
| namespace | fibonacci |
| Functions for Fibonacci sequence. | |
Functions | |
| uint64_t | math::fibonacci::fibonacci (uint64_t n) |
| Function to compute the n-th Fibonacci number. | |
| static void | test () |
| Self-test implementation. | |
| int | main () |
| Main function. | |
n-th Fibonacci number.
Naive recursive implementation to calculate the n-th Fibonacci number.
\[\text{fib}(n) = \text{fib}(n-1) + \text{fib}(n-2)\]
| uint64_t math::fibonacci::fibonacci | ( | uint64_t | n | ) |
Function to compute the n-th Fibonacci number.
| n | the index of the Fibonacci number |
| int main | ( | void | ) |
|
static |
Self-test implementation.
void