C Workshop
Fibonacci.c File Reference
#include <stdlib.h>
#include <malloc.h>
#include "Fibonacci.h"

Functions

ull_t Fibonacci (size_t n)
 Returns the nth fibonacci number. More...
 
int InitFibonacci (void)
 Initializes resources for Fibonacci. More...
 
void FinalizeFibonacci (void)
 Frees resources for Fibonacci. More...
 

Function Documentation

◆ Fibonacci()

ull_t Fibonacci ( size_t  n)

Returns the nth fibonacci number.

Parameters
nThe index of the fibonacci number to return
Returns
The nth fibonacci number

◆ FinalizeFibonacci()

void FinalizeFibonacci ( void  )

Frees resources for Fibonacci.

Note
This function can be called multiple times. After calling Fibonacci, you will need to call this function again to free the resources.

◆ InitFibonacci()

int InitFibonacci ( void  )

Initializes resources for Fibonacci.

Returns
0 on success, -1 on failure to allocate memory