source: branches/libc-0.6/src/emx/include/float.h

Last change on this file was 2013, checked in by bird, 20 years ago

o The smallcnv stuff is gone, waste of space since we're not really into

static linking. Should've done this when switching to gdtoa.

o Ported the msun and some other math bits from current FreeBSD libc.

This mostly replaces the EMX math, except for some double long variants
and some EMX specific ones. This is a risky change, but it's needed
if we're gonna catch up on the C99 bits and make libstdc++ happy.
There are some new headers, complex.h and fenv.h being the importan ones.
float.h have gotten some updates while math.h is totally replaced.
More than 100 standard functions were added!
NOTE: msun is using MATH_ERREXCEPT (math_errhandling) and not

MATH_ERRNO for error reporting.

I really hope this is not gonna uncover more OS/2 387 mess.

  • Property cvs2svn:cvs-rev set to 1.6
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 3.3 KB
Line 
1/* float.h,v 1.5 2004/09/14 22:27:33 bird Exp */
2/** @file
3 * EMX + GCC + Some FreeBSD Bits.
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__BEGIN_DECLS
14extern int __flt_rounds(void);
15__END_DECLS
16
17#define FLT_RADIX 2 /* b */
18#define FLT_ROUNDS __flt_rounds()
19
20#define FLT_EVAL_METHOD (-1) /* i387 semantics are...interesting */
21#define DECIMAL_DIG 21 /* max precision in decimal digits */
22
23#define FLT_MANT_DIG 24
24#define FLT_MIN_EXP (-125)
25#define FLT_MAX_EXP 128
26#define FLT_DIG 6
27#define FLT_MIN_10_EXP (-37)
28#define FLT_MAX_10_EXP 38
29#define FLT_MIN 1.17549435e-38F
30#define FLT_MAX 3.40282347e+38F
31#define FLT_EPSILON 1.19209290e-07F
32
33#define DBL_MANT_DIG 53
34#define DBL_MIN_EXP (-1021)
35#define DBL_MAX_EXP 1024
36#define DBL_DIG 15
37#define DBL_MIN_10_EXP (-307)
38#define DBL_MAX_10_EXP 308
39#define DBL_MIN 2.2250738585072014e-308
40#define DBL_MAX 1.7976931348623157e+308
41#define DBL_EPSILON 2.2204460492503131e-016
42
43/* bird: There is some divergence in the values for this section.
44 * We'll go for the GCC values. */
45#define LDBL_MANT_DIG 64
46#define LDBL_MIN_EXP (-16381)
47#define LDBL_MAX_EXP 16384
48#define LDBL_DIG 18
49#define LDBL_MIN_10_EXP (-4931)
50#define LDBL_MAX_10_EXP 4932
51#if 0
52/* emx: */
53#define LDBL_MIN 3.3621031431120935063e-4932L
54#define LDBL_MAX 1.1897314953572317650e+4932L
55#define LDBL_EPSILON 1.08420217248550443400745280086994171142578125e-0019L
56#else
57/* gcc: i386 config */
58#define LDBL_MIN 3.36210314311209350626e-4932L
59#define LDBL_MAX 1.18973149535723176502e+4932L
60#define LDBL_EPSILON 1.08420217248550443401e-19L
61#endif
62
63
64/* bird: FreeBSD stuff at top, this is from gcc, wonder who's right...
65#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
66#define FLT_EVAL_METHOD 0
67#define DECIMAL_DIG 17
68#endif */ /* C99 */
69
70
71#if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) || defined(__USE_EMX)
72
73#if !defined (_OMIT_387_STUFF)
74
75#define MCW_EM 0x003f
76#define EM_INVALID 0x0001
77#define EM_DENORMAL 0x0002
78#define EM_ZERODIVIDE 0x0004
79#define EM_OVERFLOW 0x0008
80#define EM_UNDERFLOW 0x0010
81#define EM_INEXACT 0x0020
82
83#define MCW_IC 0x1000
84#define IC_PROJECTIVE 0x0000
85#define IC_AFFINE 0x1000
86
87#define MCW_RC 0x0c00
88#define RC_NEAR 0x0000
89#define RC_DOWN 0x0400
90#define RC_UP 0x0800
91#define RC_CHOP 0x0c00
92
93#define MCW_PC 0x0300
94#define PC_24 0x0000
95#define PC_53 0x0200
96#define PC_64 0x0300
97
98#define CW_DEFAULT (RC_NEAR | PC_64 | MCW_EM)
99
100#define SW_INVALID 0x0001
101#define SW_DENORMAL 0x0002
102#define SW_ZERODIVIDE 0x0004
103#define SW_OVERFLOW 0x0008
104#define SW_UNDERFLOW 0x0010
105#define SW_INEXACT 0x0020
106#define SW_STACKFAULT 0x0040
107#define SW_STACKOVERFLOW 0x0200
108
109__BEGIN_DECLS
110unsigned _clear87 (void);
111unsigned _control87 (unsigned, unsigned);
112void _fpreset (void);
113unsigned _status87 (void);
114__END_DECLS
115
116#endif /* !defined (_OMIT_387_STUFF) */
117#endif
118
119#endif /* not _FLOAT_H */
Note: See TracBrowser for help on using the repository browser.