| Turnstone Operating System
    | 
Math header. More...
#include <utils.h>| Macros | |
| #define | ___MATH_H 0 | 
| #define | EXP ((float64_t)(2.71828182845904523536L)) | 
| #define | LN2 ((float64_t)(0.69314718055994506418L)) | 
| #define | LN10 ((float64_t)(2.30258509299404590109L)) | 
| #define | PI ((float64_t)(3.14159265358979323846L)) | 
| #define | PI_2 ((float64_t)(1.57079632679489661923L)) | 
| #define | PI_1_2 ((float64_t)(0.318309886183790671538L)) | 
| #define | PI_2_2 ((float64_t)(0.636619772367581343076L)) | 
| #define | math_log2(n) | 
| ! log2 of n | |
| #define | math_log10(n) | 
| ! log10 of n | |
| #define | MATH_EXP_MASK 0x7FF0000000000000ULL | 
| ! exponent part of float64_t | |
| #define | MATH_FRAC_MASK 0x000FFFFFFFFFFFFFULL | 
| ! fraction part of float64_t | |
| Functions | |
| int64_t | math_ceil (float64_t num) | 
| ceil of given float number | |
| int64_t | math_floor (float64_t num) | 
| floor of given float number | |
| float64_t | math_power (float64_t base, float64_t p) | 
| power base with p | |
| float64_t | math_exp (float64_t number) | 
| calculates exp^number | |
| float64_t | math_log (float64_t number) | 
| calculates log given number at base exp | |
| float64_t | math_antilog (float64_t power, float64_t base) | 
| calculates antilog value | |
| float64_t | math_root (float64_t number, float64_t root) | 
| calculates root of given number at root | |
| float64_t | math_sin (float64_t number) | 
| calculates sin of x | |
| boolean_t | math_isnan (float64_t number) | 
| checks if given number is nan | |
| boolean_t | math_isinf (float64_t number) | 
| checks if given number is infinite | |
Math header.
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
| #define math_log10 | ( | n | ) | 
| #define math_log2 | ( | n | ) | 
! log2 of n
calculates antilog value
| [in] | power | given number | 
| [in] | base | log base | 
ceil of given float number
| [in] | num | given float number | 
calculates exp^number
| [in] | number | number to calculate | 
floor of given float number
| [in] | num | given float number | 
| boolean_t math_isinf | ( | float64_t | number | ) | 
checks if given number is infinite
| [in] | number | number for calculation | 
| boolean_t math_isnan | ( | float64_t | number | ) | 
checks if given number is nan
| [in] | number | number for calculation | 
calculates log given number at base exp
| [in] | number | number to calculate | 
power base with p
| [in] | base | the base | 
| [in] | p | the power | 
calculates root of given number at root
| [in] | number | given number | 
| [in] | root | root to calculate |