2022-06-06 10:49:19 +00:00
|
|
|
|
|
|
|
#pragma once
|
2022-06-02 06:28:17 +00:00
|
|
|
|
|
|
|
typedef float float_t;
|
|
|
|
typedef double double_t;
|
|
|
|
|
|
|
|
#ifndef _HUGE_ENUF
|
|
|
|
#define _HUGE_ENUF 1e+300 // _HUGE_ENUF*_HUGE_ENUF must overflow
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF))
|
|
|
|
#define HUGE_VAL ((double)INFINITY)
|
|
|
|
#define HUGE_VALF ((float)INFINITY)
|
|
|
|
|
|
|
|
#define NAN (-(float)(INFINITY * 0.0F))
|
|
|
|
|
2022-06-08 04:34:37 +00:00
|
|
|
// FP_ILOGB0
|
|
|
|
// FP_ILOGBNAN
|
|
|
|
|
|
|
|
#define MATH_ERRNO 0
|
|
|
|
#define MATH_ERREXCEPT 1
|
|
|
|
|
|
|
|
#define math_errhandling MATH_ERRNO
|
|
|
|
|
|
|
|
#define FP_INFINITE 0
|
|
|
|
#define FP_NAN 1
|
|
|
|
#define FP_NORMAL 2
|
|
|
|
#define FP_SUBNORMAL 3
|
|
|
|
#define FP_ZERO 4
|
|
|
|
#define fpclassify(x) ( \
|
|
|
|
_is_float(x) ? _fpclassify_f(x) :
|
|
|
|
_is_double(x) ? _fpclassify_d(x) :
|
|
|
|
FP_NAN)
|
2022-06-02 06:28:17 +00:00
|
|
|
|
|
|
|
double acos(double x);
|
|
|
|
float acosf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double asin(double x);
|
|
|
|
float asinf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double atan(double x);
|
|
|
|
float atanf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double atan2(double y, double x);
|
|
|
|
float atan2f(float y, float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double cos(double x);
|
|
|
|
float cosf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double sin(double x);
|
|
|
|
float sinf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double tan(double x);
|
|
|
|
float tanf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double acosh(double x);
|
|
|
|
float acoshf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double asinh(double x);
|
|
|
|
float asinhf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double atanh(double x);
|
|
|
|
float atanhf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double cosh(double x);
|
|
|
|
float coshf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double sinh(double x);
|
|
|
|
float sinhf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double tanh(double x);
|
|
|
|
float tanhf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double exp(double x);
|
|
|
|
float expf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double exp2(double x);
|
|
|
|
float exp2f(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double expm1(double x);
|
|
|
|
float expm1f(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double frexp(double value, int *exp);
|
|
|
|
float frexpf(float value, int *exp);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
int ilogb(double x);
|
|
|
|
int ilogbf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double ldexp(double x, int exp);
|
|
|
|
float ldexpf(float x, int exp);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double log(double x);
|
|
|
|
float logf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double log10(double x);
|
|
|
|
float log10f(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double log1p(double x);
|
|
|
|
float log1pf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double log2(double x);
|
|
|
|
float log2f(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double logb(double x);
|
|
|
|
float logbf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double modf(double value, double *iptr);
|
|
|
|
float modff(float value, float *iptr);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double scalbn(double x, int n);
|
|
|
|
float scalbnf(float x, int n);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double scalbln(double x, long int n);
|
|
|
|
float scalblnf(float x, long int n);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double cbrt(double x);
|
|
|
|
float cbrtf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double fabs(double x);
|
|
|
|
float fabsf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double hypot(double x, double y);
|
|
|
|
float hypotf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double pow(double x, double y);
|
|
|
|
float powf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double sqrt(double x);
|
|
|
|
float sqrtf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double erf(double x);
|
|
|
|
float erff(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double erfc(double x);
|
|
|
|
float erfcf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double lgamma(double x);
|
|
|
|
float lgammaf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double tgamma(double x);
|
|
|
|
float tgammaf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double ceil(double x);
|
|
|
|
float ceilf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double floor(double x);
|
|
|
|
float floorf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double nearbyint(double x);
|
|
|
|
float nearbyintf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double rint(double x);
|
|
|
|
float rintf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
long int lrint(double x);
|
|
|
|
long int lrintf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
long long int llrint(double x);
|
|
|
|
long long int llrintf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double round(double x);
|
|
|
|
float roundf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
long int lround(double x);
|
|
|
|
long int lroundf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
long long int llround(double x);
|
|
|
|
long long int llroundf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double trunc(double x);
|
|
|
|
float truncf(float x);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double fmod(double x, double y);
|
|
|
|
float fmodf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double remainder(double x, double y);
|
|
|
|
float remainderf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double remquo(double x, double y, int *quo);
|
|
|
|
float remquof(float x, float y, int *quo);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double copysign(double x, double y);
|
|
|
|
float copysignf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double nan(const char *tagp);
|
|
|
|
float nanf(const char *tagp);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double nextafter(double x, double y);
|
|
|
|
float nextafterf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double fdim(double x, double y);
|
|
|
|
float fdimf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double fmax(double x, double y);
|
|
|
|
float fmaxf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double fmin(double x, double y);
|
|
|
|
float fminf(float x, float y);
|
2022-06-08 04:34:37 +00:00
|
|
|
|
2022-06-02 06:28:17 +00:00
|
|
|
double fma(double x, double y, double z);
|
|
|
|
float fmaf(float x, float y, float z);
|
2022-06-08 04:34:37 +00:00
|
|
|
|