libcproject
C static library easier to use than libc (C standard library).
mathematics.h File Reference
#include <errno.h>
#include <stdbool.h>
#include "types.h"
Include dependency graph for mathematics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MATHEMATICS_FLOAT_PRECISION   0.00000001
 

Functions

bool mathematics_equals (const float number1, const float number2)
 Verify that 2 numbers are equal. More...
 
unsigned long long mathematics_absolute_value (const long long number)
 Get the absolute value of a number. More...
 
unsigned long long mathematics_pow (unsigned long long base, unsigned long long exponent)
 Calculates the power of a number. More...
 
float mathematics_root (float number, unsigned int nth_root)
 Calculates the nth root of a number. More...
 
float mathematics_square_root (float number)
 Calculates the square root of a number using Heron's method. More...
 
unsigned long long mathematics_factorial (unsigned long long number)
 Calculates the factorial of a number. More...
 

Macro Definition Documentation

◆ MATHEMATICS_FLOAT_PRECISION

#define MATHEMATICS_FLOAT_PRECISION   0.00000001

Definition at line 4 of file mathematics.h.

Function Documentation

◆ mathematics_equals()

bool mathematics_equals ( const float  number1,
const float  number2 
)

Verify that 2 numbers are equal.

Parameters
number1
number2
Returns
true
false
Since
v1.0.0

◆ mathematics_absolute_value()

unsigned long long mathematics_absolute_value ( const long long  number)

Get the absolute value of a number.

Parameters
number
Returns
unsigned long long
Since
v1.0.0

◆ mathematics_pow()

unsigned long long mathematics_pow ( unsigned long long  base,
unsigned long long  exponent 
)

Calculates the power of a number.

Parameters
base
exponent
Returns
unsigned long long
Since
v1.0.0

◆ mathematics_root()

float mathematics_root ( float  number,
unsigned int  nth_root 
)

Calculates the nth root of a number.

Parameters
number
nth_root
Returns
float
Since
v1.0.0

◆ mathematics_square_root()

float mathematics_square_root ( float  number)

Calculates the square root of a number using Heron's method.

Parameters
number
Returns
float
Since
v1.0.0

◆ mathematics_factorial()

unsigned long long mathematics_factorial ( unsigned long long  number)

Calculates the factorial of a number.

Parameters
number
Returns
unsigned long long
Since
v1.0.0