1 | /* winFuncs.h |
---|
2 | Definitions for missing math lib functions |
---|
3 | Andrew Jackson, October 2007 |
---|
4 | */ |
---|
5 | |
---|
6 | double fmax(double x, double y); |
---|
7 | //long double fmaxl (long double x, long double y); |
---|
8 | //float fmaxf (float x, float y); |
---|
9 | |
---|
10 | double fmin(double x, double y); |
---|
11 | |
---|
12 | double trunc(double x); |
---|
13 | //long double truncl(long double x); |
---|
14 | //float truncf(float x); |
---|
15 | |
---|
16 | double erf(double x); |
---|
17 | //long double erfl(long double x); |
---|
18 | //float erff (float x); |
---|
19 | //double erfc(double x); |
---|
20 | //long double erfcl(long double x); |
---|
21 | //float erfcf(float x; |
---|
22 | |
---|
23 | |
---|
24 | // Define INFINITY and NAN |
---|
25 | typedef union { unsigned char __c[4]; float __f; } __huge_valf_t; |
---|
26 | |
---|
27 | # if __BYTE_ORDER == __BIG_ENDIAN |
---|
28 | # define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } |
---|
29 | # endif |
---|
30 | # if __BYTE_ORDER == __LITTLE_ENDIAN |
---|
31 | # define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f } |
---|
32 | # endif |
---|
33 | |
---|
34 | static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; |
---|
35 | # define INFINITY (__huge_valf.__f) |
---|
36 | |
---|
37 | |
---|
38 | # if __BYTE_ORDER == __BIG_ENDIAN |
---|
39 | # define __nan_bytes { 0x7f, 0xc0, 0, 0 } |
---|
40 | # endif |
---|
41 | # if __BYTE_ORDER == __LITTLE_ENDIAN |
---|
42 | # define __nan_bytes { 0, 0, 0xc0, 0x7f } |
---|
43 | # endif |
---|
44 | |
---|
45 | static union { unsigned char __c[4]; float __d; } __nan_union; |
---|
46 | # define NAN (__nan_union.__d) |
---|
47 | |
---|