source: trunk/src/emx/include/float.h@ 1181

Last change on this file since 1181 was 1181, checked in by bird, 22 years ago

Use FreeBSD DECIMAL_DIG & FLT_EVAL_METHOD.

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