diff options
author | 2022-04-07 19:33:30 +0530 | |
---|---|---|
committer | 2022-04-07 19:33:30 +0530 | |
commit | 54d5ba67489b3fdaf437c05675eb9b1f6d085a84 (patch) | |
tree | d53df52fbfb1f440bba34799c2fcf7ff1ce75a57 /math/maths.h | |
download | fflibc-main.tar fflibc-main.tar.gz fflibc-main.tar.bz2 fflibc-main.tar.lz fflibc-main.tar.xz fflibc-main.tar.zst fflibc-main.zip |
Initial commitmain
Diffstat (limited to 'math/maths.h')
-rw-r--r-- | math/maths.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/math/maths.h b/math/maths.h new file mode 100644 index 0000000..c330d0c --- /dev/null +++ b/math/maths.h @@ -0,0 +1,41 @@ +#if !defined(MATH_H) + #define MATH_H + + #include <stdint.h> + +extern int abs(int n); +extern long labs(long n); +extern long long llabs(long long n); +extern intmax_t imaxabs(intmax_t n); +extern float fabsf(float n); +extern double fabs(double n); +extern long double fabsl(long double n); + + #if __STDC_HOSTED__ == 1 + #include <inttypes.h> + #include <stdlib.h> + #else + +typedef struct { + int quot, rem; +} div_t; + +typedef struct { + long quot, rem; +} ldiv_t; + +typedef struct { + long long quot, rem; +} lldiv_t; + +typedef struct { + intmax_t quot, rem; +} imaxdiv_t; + #endif + +extern div_t div(int numerator, int denominator); +extern ldiv_t ldiv(long numerator, long denominator); +extern lldiv_t lldiv(long long numerator, long long denominator); +extern imaxdiv_t imaxdiv(intmax_t numerator, intmax_t denominator); + +#endif |