1 | /* float.h,v 1.5 2004/09/14 22:27:33 bird Exp */
|
---|
2 | /** @file
|
---|
3 | * EMX + GCC
|
---|
4 | *
|
---|
5 | * @remark Must be used instead of the GCC one.
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef _FLOAT_H
|
---|
9 | #define _FLOAT_H
|
---|
10 |
|
---|
11 | #include <sys/cdefs.h>
|
---|
12 |
|
---|
13 |
|
---|
14 | #define FLT_RADIX 2 /* b */
|
---|
15 | #define FLT_ROUNDS 1 /* FP addition rounds to nearest */
|
---|
16 | #define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */
|
---|
17 | #define DECIMAL_DIG 21 /* max precision in decimal digits */
|
---|
18 |
|
---|
19 | #define FLT_MANT_DIG 24
|
---|
20 | #define FLT_MIN_EXP (-125)
|
---|
21 | #define FLT_MAX_EXP 128
|
---|
22 | #define FLT_DIG 6
|
---|
23 | #define FLT_MIN_10_EXP (-37)
|
---|
24 | #define FLT_MAX_10_EXP 38
|
---|
25 | #define FLT_MIN 1.17549435e-38F
|
---|
26 | #define FLT_MAX 3.40282347e+38F
|
---|
27 | #define FLT_EPSILON 1.19209290e-07F
|
---|
28 |
|
---|
29 | #define DBL_MANT_DIG 53
|
---|
30 | #define DBL_MIN_EXP (-1021)
|
---|
31 | #define DBL_MAX_EXP 1024
|
---|
32 | #define DBL_DIG 15
|
---|
33 | #define DBL_MIN_10_EXP (-307)
|
---|
34 | #define DBL_MAX_10_EXP 308
|
---|
35 | #define DBL_MIN 2.2250738585072014e-308
|
---|
36 | #define DBL_MAX 1.7976931348623157e+308
|
---|
37 | #define DBL_EPSILON 2.2204460492503131e-016
|
---|
38 |
|
---|
39 | /* bird: There is some divergence in the values for this section.
|
---|
40 | * We'll go for the GCC values. */
|
---|
41 | #define LDBL_MANT_DIG 64
|
---|
42 | #define LDBL_MIN_EXP (-16381)
|
---|
43 | #define LDBL_MAX_EXP 16384
|
---|
44 | #define LDBL_DIG 18
|
---|
45 | #define LDBL_MIN_10_EXP (-4931)
|
---|
46 | #define LDBL_MAX_10_EXP 4932
|
---|
47 | #if 0
|
---|
48 | /* emx: */
|
---|
49 | #define LDBL_MIN 3.3621031431120935063e-4932L
|
---|
50 | #define LDBL_MAX 1.1897314953572317650e+4932L
|
---|
51 | #define LDBL_EPSILON 1.08420217248550443400745280086994171142578125e-0019L
|
---|
52 | #else
|
---|
53 | /* gcc: i386 config */
|
---|
54 | #define LDBL_MIN 3.36210314311209350626e-4932L
|
---|
55 | #define LDBL_MAX 1.18973149535723176502e+4932L
|
---|
56 | #define LDBL_EPSILON 1.08420217248550443401e-19L
|
---|
57 | #endif
|
---|
58 |
|
---|
59 |
|
---|
60 | /* bird: FreeBSD stuff at top, this is from gcc, wonder who's right...
|
---|
61 | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
---|
62 | #define FLT_EVAL_METHOD 0
|
---|
63 | #define DECIMAL_DIG 17
|
---|
64 | #endif */ /* C99 */
|
---|
65 |
|
---|
66 |
|
---|
67 | #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) || defined(__USE_EMX)
|
---|
68 |
|
---|
69 | #define M_E 2.71828182845904523536
|
---|
70 | #define M_LOG2E 1.44269504088896340736
|
---|
71 | #define M_LOG10E 0.434294481903251827651
|
---|
72 | #define M_LN2 0.693147180559945309422
|
---|
73 | #define M_LN10 2.302585092994045684018
|
---|
74 |
|
---|
75 | #define M_PI 3.14159265358979323846
|
---|
76 | #define M_PI_2 1.57079632679489661923
|
---|
77 | #define M_PI_4 0.785398163397448309616
|
---|
78 | #define M_1_PI 0.318309886183790671538
|
---|
79 | #define M_2_PI 0.636619772367581343076
|
---|
80 | #define M_2_SQRTPI 1.12837916709551257390
|
---|
81 |
|
---|
82 | #define M_SQRT2 1.41421356237309504880
|
---|
83 | #define M_SQRT1_2 0.707106781186547524401
|
---|
84 |
|
---|
85 | #if !defined (_OMIT_387_STUFF)
|
---|
86 |
|
---|
87 | #define MCW_EM 0x003f
|
---|
88 | #define EM_INVALID 0x0001
|
---|
89 | #define EM_DENORMAL 0x0002
|
---|
90 | #define EM_ZERODIVIDE 0x0004
|
---|
91 | #define EM_OVERFLOW 0x0008
|
---|
92 | #define EM_UNDERFLOW 0x0010
|
---|
93 | #define EM_INEXACT 0x0020
|
---|
94 |
|
---|
95 | #define MCW_IC 0x1000
|
---|
96 | #define IC_PROJECTIVE 0x0000
|
---|
97 | #define IC_AFFINE 0x1000
|
---|
98 |
|
---|
99 | #define MCW_RC 0x0c00
|
---|
100 | #define RC_NEAR 0x0000
|
---|
101 | #define RC_DOWN 0x0400
|
---|
102 | #define RC_UP 0x0800
|
---|
103 | #define RC_CHOP 0x0c00
|
---|
104 |
|
---|
105 | #define MCW_PC 0x0300
|
---|
106 | #define PC_24 0x0000
|
---|
107 | #define PC_53 0x0200
|
---|
108 | #define PC_64 0x0300
|
---|
109 |
|
---|
110 | #define CW_DEFAULT (RC_NEAR | PC_64 | MCW_EM)
|
---|
111 |
|
---|
112 | #define SW_INVALID 0x0001
|
---|
113 | #define SW_DENORMAL 0x0002
|
---|
114 | #define SW_ZERODIVIDE 0x0004
|
---|
115 | #define SW_OVERFLOW 0x0008
|
---|
116 | #define SW_UNDERFLOW 0x0010
|
---|
117 | #define SW_INEXACT 0x0020
|
---|
118 | #define SW_STACKFAULT 0x0040
|
---|
119 | #define SW_STACKOVERFLOW 0x0200
|
---|
120 |
|
---|
121 | __BEGIN_DECLS
|
---|
122 | unsigned _clear87 (void);
|
---|
123 | unsigned _control87 (unsigned, unsigned);
|
---|
124 | void _fpreset (void);
|
---|
125 | unsigned _status87 (void);
|
---|
126 | __END_DECLS
|
---|
127 |
|
---|
128 | #endif /* !defined (_OMIT_387_STUFF) */
|
---|
129 | #endif
|
---|
130 |
|
---|
131 | #endif /* not _FLOAT_H */
|
---|