libcproject
C static library easier to use than libc (C standard library).
mathematics.h
Go to the documentation of this file.
1 #ifndef __LIBCPROJECT_MATHEMATICS__
2 #define __LIBCPROJECT_MATHEMATICS__
3 
4 #define MATHEMATICS_FLOAT_PRECISION 0.00000001
5 
6 #include <errno.h>
7 #include <stdbool.h>
8 
9 #include "types.h"
10 
20 bool mathematics_equals(const float number1, const float number2);
21 
29 unsigned long long mathematics_absolute_value(const long long number);
30 
39 unsigned long long mathematics_pow(unsigned long long base, unsigned long long exponent);
40 
49 float mathematics_root(float number, unsigned int nth_root);
50 
58 float mathematics_square_root(float number);
59 
67 unsigned long long mathematics_factorial(unsigned long long number);
68 
69 #endif
bool mathematics_equals(const float number1, const float number2)
Verify that 2 numbers are equal.
unsigned long long mathematics_pow(unsigned long long base, unsigned long long exponent)
Calculates the power of a number.
float mathematics_square_root(float number)
Calculates the square root of a number using Heron's method.
unsigned long long mathematics_factorial(unsigned long long number)
Calculates the factorial of a number.
unsigned long long mathematics_absolute_value(const long long number)
Get the absolute value of a number.
float mathematics_root(float number, unsigned int nth_root)
Calculates the nth root of a number.