summaryrefslogtreecommitdiff
path: root/userland/libc/include/math.h
blob: 7168a5daed64dce06042be286edb461f717c190b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#define max(_a, _b) ((_a) > (_b) ? (_a) : (_b))
#define min(_a, _b) ((_a) < (_b) ? (_a) : (_b))

#if 100*__GNUC__+__GNUC_MINOR__ >= 303
#define NAN       __builtin_nanf("")
#define INFINITY  __builtin_inff()
#else
#define NAN       (0.0f/0.0f)
#define INFINITY  1e40f
#endif

#define HUGE_VALF INFINITY
#define HUGE_VAL  ((double)INFINITY)
#define HUGE_VALL ((long double)INFINITY)

double ldexp(double x, int exp);
double fmin(double x, double y);