Mass reformat
This commit is contained in:
parent
4d27def35e
commit
df11e34235
27 changed files with 121 additions and 136 deletions
5
fibmat.c
5
fibmat.c
|
|
@ -1,5 +1,5 @@
|
|||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/**
|
||||
* @brief Computes the n-th Fibonacci number using matrix exponentiation.
|
||||
|
|
@ -48,7 +48,8 @@ static FibMatrix matrix_power(FibMatrix base, uint32_t n) {
|
|||
}
|
||||
|
||||
uint64_t fibonacci_matrix(uint32_t n) {
|
||||
if (n == 0) return 0;
|
||||
if (n == 0)
|
||||
return 0;
|
||||
FibMatrix base = {1, 1, 1, 0};
|
||||
FibMatrix result = matrix_power(base, n - 1);
|
||||
return result.a;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue