annotate gcc/ginclude/float.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1 /* Copyright (C) 2002-2018 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 Under Section 7 of GPL version 3, you are granted additional
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 permissions described in the GCC Runtime Library Exception, version
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 3.1, as published by the Free Software Foundation.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 a copy of the GCC Runtime Library Exception along with this program;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 /*
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 * ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 #ifndef _FLOAT_H___
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 #define _FLOAT_H___
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 /* Radix of exponent representation, b. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 #undef FLT_RADIX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 #define FLT_RADIX __FLT_RADIX__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 /* Number of base-FLT_RADIX digits in the significand, p. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 #undef FLT_MANT_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 #undef DBL_MANT_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 #undef LDBL_MANT_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 #define FLT_MANT_DIG __FLT_MANT_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 #define DBL_MANT_DIG __DBL_MANT_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 #define LDBL_MANT_DIG __LDBL_MANT_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 /* Number of decimal digits, q, such that any floating-point number with q
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 decimal digits can be rounded into a floating-point number with p radix b
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 digits and back again without change to the q decimal digits,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 p * log10(b) if b is a power of 10
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 floor((p - 1) * log10(b)) otherwise
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 #undef FLT_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 #undef DBL_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 #undef LDBL_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 #define FLT_DIG __FLT_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 #define DBL_DIG __DBL_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 #define LDBL_DIG __LDBL_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 /* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 #undef FLT_MIN_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 #undef DBL_MIN_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 #undef LDBL_MIN_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 #define FLT_MIN_EXP __FLT_MIN_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 #define DBL_MIN_EXP __DBL_MIN_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 #define LDBL_MIN_EXP __LDBL_MIN_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 /* Minimum negative integer such that 10 raised to that power is in the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 range of normalized floating-point numbers,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 ceil(log10(b) * (emin - 1))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 #undef FLT_MIN_10_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 #undef DBL_MIN_10_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 #undef LDBL_MIN_10_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 /* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 #undef FLT_MAX_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 #undef DBL_MAX_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 #undef LDBL_MAX_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 #define FLT_MAX_EXP __FLT_MAX_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 #define DBL_MAX_EXP __DBL_MAX_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 #define LDBL_MAX_EXP __LDBL_MAX_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 /* Maximum integer such that 10 raised to that power is in the range of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 representable finite floating-point numbers,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 floor(log10((1 - b**-p) * b**emax))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 #undef FLT_MAX_10_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 #undef DBL_MAX_10_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 #undef LDBL_MAX_10_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 /* Maximum representable finite floating-point number,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 (1 - b**-p) * b**emax
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 #undef FLT_MAX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 #undef DBL_MAX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 #undef LDBL_MAX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 #define FLT_MAX __FLT_MAX__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 #define DBL_MAX __DBL_MAX__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 #define LDBL_MAX __LDBL_MAX__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 /* The difference between 1 and the least value greater than 1 that is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 representable in the given floating point type, b**1-p. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 #undef FLT_EPSILON
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 #undef DBL_EPSILON
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 #undef LDBL_EPSILON
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 #define FLT_EPSILON __FLT_EPSILON__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 #define DBL_EPSILON __DBL_EPSILON__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 #define LDBL_EPSILON __LDBL_EPSILON__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 /* Minimum normalized positive floating-point number, b**(emin - 1). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 #undef FLT_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 #undef DBL_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 #undef LDBL_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 #define FLT_MIN __FLT_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 #define DBL_MIN __DBL_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 #define LDBL_MIN __LDBL_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 /* ??? This is supposed to change with calls to fesetround in <fenv.h>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 #undef FLT_ROUNDS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 #define FLT_ROUNDS 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
111
kono
parents: 67
diff changeset
130 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
kono
parents: 67
diff changeset
131 || (defined (__cplusplus) && __cplusplus >= 201103L)
kono
parents: 67
diff changeset
132 /* The floating-point expression evaluation method. The precise
kono
parents: 67
diff changeset
133 definitions of these values are generalised to include support for
kono
parents: 67
diff changeset
134 the interchange and extended types defined in ISO/IEC TS 18661-3.
kono
parents: 67
diff changeset
135 Prior to this (for C99/C11) the definitions were:
kono
parents: 67
diff changeset
136
kono
parents: 67
diff changeset
137 -1 indeterminate
kono
parents: 67
diff changeset
138 0 evaluate all operations and constants just to the range and
kono
parents: 67
diff changeset
139 precision of the type
kono
parents: 67
diff changeset
140 1 evaluate operations and constants of type float and double
kono
parents: 67
diff changeset
141 to the range and precision of the double type, evaluate
kono
parents: 67
diff changeset
142 long double operations and constants to the range and
kono
parents: 67
diff changeset
143 precision of the long double type
kono
parents: 67
diff changeset
144 2 evaluate all operations and constants to the range and
kono
parents: 67
diff changeset
145 precision of the long double type
kono
parents: 67
diff changeset
146
kono
parents: 67
diff changeset
147 The TS 18661-3 definitions are:
kono
parents: 67
diff changeset
148
kono
parents: 67
diff changeset
149 -1 indeterminate
kono
parents: 67
diff changeset
150 0 evaluate all operations and constants, whose semantic type has
kono
parents: 67
diff changeset
151 at most the range and precision of float, to the range and
kono
parents: 67
diff changeset
152 precision of float; evaluate all other operations and constants
kono
parents: 67
diff changeset
153 to the range and precision of the semantic type.
kono
parents: 67
diff changeset
154 1 evaluate all operations and constants, whose semantic type has
kono
parents: 67
diff changeset
155 at most the range and precision of double, to the range and
kono
parents: 67
diff changeset
156 precision of double; evaluate all other operations and constants
kono
parents: 67
diff changeset
157 to the range and precision of the semantic type.
kono
parents: 67
diff changeset
158 2 evaluate all operations and constants, whose semantic type has
kono
parents: 67
diff changeset
159 at most the range and precision of long double, to the range and
kono
parents: 67
diff changeset
160 precision of long double; evaluate all other operations and
kono
parents: 67
diff changeset
161 constants to the range and precision of the semantic type.
kono
parents: 67
diff changeset
162 N where _FloatN is a supported interchange floating type
kono
parents: 67
diff changeset
163 evaluate all operations and constants, whose semantic type has
kono
parents: 67
diff changeset
164 at most the range and precision of the _FloatN type, to the
kono
parents: 67
diff changeset
165 range and precision of the _FloatN type; evaluate all other
kono
parents: 67
diff changeset
166 operations and constants to the range and precision of the
kono
parents: 67
diff changeset
167 semantic type.
kono
parents: 67
diff changeset
168 N + 1, where _FloatNx is a supported extended floating type
kono
parents: 67
diff changeset
169 evaluate operations and constants, whose semantic type has at
kono
parents: 67
diff changeset
170 most the range and precision of the _FloatNx type, to the range
kono
parents: 67
diff changeset
171 and precision of the _FloatNx type; evaluate all other
kono
parents: 67
diff changeset
172 operations and constants to the range and precision of the
kono
parents: 67
diff changeset
173 semantic type.
kono
parents: 67
diff changeset
174
kono
parents: 67
diff changeset
175 The compiler predefines two macros:
kono
parents: 67
diff changeset
176
kono
parents: 67
diff changeset
177 __FLT_EVAL_METHOD__
kono
parents: 67
diff changeset
178 Which, depending on the value given for
kono
parents: 67
diff changeset
179 -fpermitted-flt-eval-methods, may be limited to only those values
kono
parents: 67
diff changeset
180 for FLT_EVAL_METHOD defined in C99/C11.
kono
parents: 67
diff changeset
181
kono
parents: 67
diff changeset
182 __FLT_EVAL_METHOD_TS_18661_3__
kono
parents: 67
diff changeset
183 Which always permits the values for FLT_EVAL_METHOD defined in
kono
parents: 67
diff changeset
184 ISO/IEC TS 18661-3.
kono
parents: 67
diff changeset
185
kono
parents: 67
diff changeset
186 Here we want to use __FLT_EVAL_METHOD__, unless
kono
parents: 67
diff changeset
187 __STDC_WANT_IEC_60559_TYPES_EXT__ is defined, in which case the user
kono
parents: 67
diff changeset
188 is specifically asking for the ISO/IEC TS 18661-3 types, so we use
kono
parents: 67
diff changeset
189 __FLT_EVAL_METHOD_TS_18661_3__.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 ??? This ought to change with the setting of the fp control word;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 the value provided by the compiler assumes the widest setting. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 #undef FLT_EVAL_METHOD
111
kono
parents: 67
diff changeset
194 #ifdef __STDC_WANT_IEC_60559_TYPES_EXT__
kono
parents: 67
diff changeset
195 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD_TS_18661_3__
kono
parents: 67
diff changeset
196 #else
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
111
kono
parents: 67
diff changeset
198 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 /* Number of decimal digits, n, such that any floating-point number in the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 widest supported floating type with pmax radix b digits can be rounded
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 to a floating-point number with n decimal digits and back again without
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 change to the value,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 pmax * log10(b) if b is a power of 10
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 ceil(1 + pmax * log10(b)) otherwise
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 #undef DECIMAL_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 #define DECIMAL_DIG __DECIMAL_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 #endif /* C99 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212
111
kono
parents: 67
diff changeset
213 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
214 /* Versions of DECIMAL_DIG for each floating-point type. */
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
215 #undef FLT_DECIMAL_DIG
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
216 #undef DBL_DECIMAL_DIG
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
217 #undef LDBL_DECIMAL_DIG
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
218 #define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
219 #define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__
111
kono
parents: 67
diff changeset
220 #define LDBL_DECIMAL_DIG __LDBL_DECIMAL_DIG__
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
221
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
222 /* Whether types support subnormal numbers. */
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
223 #undef FLT_HAS_SUBNORM
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
224 #undef DBL_HAS_SUBNORM
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
225 #undef LDBL_HAS_SUBNORM
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
226 #define FLT_HAS_SUBNORM __FLT_HAS_DENORM__
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
227 #define DBL_HAS_SUBNORM __DBL_HAS_DENORM__
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
228 #define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
229
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
230 /* Minimum positive values, including subnormals. */
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
231 #undef FLT_TRUE_MIN
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
232 #undef DBL_TRUE_MIN
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
233 #undef LDBL_TRUE_MIN
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
234 #define FLT_TRUE_MIN __FLT_DENORM_MIN__
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
235 #define DBL_TRUE_MIN __DBL_DENORM_MIN__
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
236 #define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
111
kono
parents: 67
diff changeset
237
kono
parents: 67
diff changeset
238 #endif /* C11 */
kono
parents: 67
diff changeset
239
kono
parents: 67
diff changeset
240 #ifdef __STDC_WANT_IEC_60559_BFP_EXT__
kono
parents: 67
diff changeset
241 /* Number of decimal digits for which conversions between decimal
kono
parents: 67
diff changeset
242 character strings and binary formats, in both directions, are
kono
parents: 67
diff changeset
243 correctly rounded. */
kono
parents: 67
diff changeset
244 #define CR_DECIMAL_DIG __UINTMAX_MAX__
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
245 #endif
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
246
111
kono
parents: 67
diff changeset
247 #ifdef __STDC_WANT_IEC_60559_TYPES_EXT__
kono
parents: 67
diff changeset
248 /* Constants for _FloatN and _FloatNx types from TS 18661-3. See
kono
parents: 67
diff changeset
249 comments above for their semantics. */
kono
parents: 67
diff changeset
250
kono
parents: 67
diff changeset
251 #ifdef __FLT16_MANT_DIG__
kono
parents: 67
diff changeset
252 #undef FLT16_MANT_DIG
kono
parents: 67
diff changeset
253 #define FLT16_MANT_DIG __FLT16_MANT_DIG__
kono
parents: 67
diff changeset
254 #undef FLT16_DIG
kono
parents: 67
diff changeset
255 #define FLT16_DIG __FLT16_DIG__
kono
parents: 67
diff changeset
256 #undef FLT16_MIN_EXP
kono
parents: 67
diff changeset
257 #define FLT16_MIN_EXP __FLT16_MIN_EXP__
kono
parents: 67
diff changeset
258 #undef FLT16_MIN_10_EXP
kono
parents: 67
diff changeset
259 #define FLT16_MIN_10_EXP __FLT16_MIN_10_EXP__
kono
parents: 67
diff changeset
260 #undef FLT16_MAX_EXP
kono
parents: 67
diff changeset
261 #define FLT16_MAX_EXP __FLT16_MAX_EXP__
kono
parents: 67
diff changeset
262 #undef FLT16_MAX_10_EXP
kono
parents: 67
diff changeset
263 #define FLT16_MAX_10_EXP __FLT16_MAX_10_EXP__
kono
parents: 67
diff changeset
264 #undef FLT16_MAX
kono
parents: 67
diff changeset
265 #define FLT16_MAX __FLT16_MAX__
kono
parents: 67
diff changeset
266 #undef FLT16_EPSILON
kono
parents: 67
diff changeset
267 #define FLT16_EPSILON __FLT16_EPSILON__
kono
parents: 67
diff changeset
268 #undef FLT16_MIN
kono
parents: 67
diff changeset
269 #define FLT16_MIN __FLT16_MIN__
kono
parents: 67
diff changeset
270 #undef FLT16_DECIMAL_DIG
kono
parents: 67
diff changeset
271 #define FLT16_DECIMAL_DIG __FLT16_DECIMAL_DIG__
kono
parents: 67
diff changeset
272 #undef FLT16_TRUE_MIN
kono
parents: 67
diff changeset
273 #define FLT16_TRUE_MIN __FLT16_DENORM_MIN__
kono
parents: 67
diff changeset
274 #endif /* __FLT16_MANT_DIG__. */
kono
parents: 67
diff changeset
275
kono
parents: 67
diff changeset
276 #ifdef __FLT32_MANT_DIG__
kono
parents: 67
diff changeset
277 #undef FLT32_MANT_DIG
kono
parents: 67
diff changeset
278 #define FLT32_MANT_DIG __FLT32_MANT_DIG__
kono
parents: 67
diff changeset
279 #undef FLT32_DIG
kono
parents: 67
diff changeset
280 #define FLT32_DIG __FLT32_DIG__
kono
parents: 67
diff changeset
281 #undef FLT32_MIN_EXP
kono
parents: 67
diff changeset
282 #define FLT32_MIN_EXP __FLT32_MIN_EXP__
kono
parents: 67
diff changeset
283 #undef FLT32_MIN_10_EXP
kono
parents: 67
diff changeset
284 #define FLT32_MIN_10_EXP __FLT32_MIN_10_EXP__
kono
parents: 67
diff changeset
285 #undef FLT32_MAX_EXP
kono
parents: 67
diff changeset
286 #define FLT32_MAX_EXP __FLT32_MAX_EXP__
kono
parents: 67
diff changeset
287 #undef FLT32_MAX_10_EXP
kono
parents: 67
diff changeset
288 #define FLT32_MAX_10_EXP __FLT32_MAX_10_EXP__
kono
parents: 67
diff changeset
289 #undef FLT32_MAX
kono
parents: 67
diff changeset
290 #define FLT32_MAX __FLT32_MAX__
kono
parents: 67
diff changeset
291 #undef FLT32_EPSILON
kono
parents: 67
diff changeset
292 #define FLT32_EPSILON __FLT32_EPSILON__
kono
parents: 67
diff changeset
293 #undef FLT32_MIN
kono
parents: 67
diff changeset
294 #define FLT32_MIN __FLT32_MIN__
kono
parents: 67
diff changeset
295 #undef FLT32_DECIMAL_DIG
kono
parents: 67
diff changeset
296 #define FLT32_DECIMAL_DIG __FLT32_DECIMAL_DIG__
kono
parents: 67
diff changeset
297 #undef FLT32_TRUE_MIN
kono
parents: 67
diff changeset
298 #define FLT32_TRUE_MIN __FLT32_DENORM_MIN__
kono
parents: 67
diff changeset
299 #endif /* __FLT32_MANT_DIG__. */
kono
parents: 67
diff changeset
300
kono
parents: 67
diff changeset
301 #ifdef __FLT64_MANT_DIG__
kono
parents: 67
diff changeset
302 #undef FLT64_MANT_DIG
kono
parents: 67
diff changeset
303 #define FLT64_MANT_DIG __FLT64_MANT_DIG__
kono
parents: 67
diff changeset
304 #undef FLT64_DIG
kono
parents: 67
diff changeset
305 #define FLT64_DIG __FLT64_DIG__
kono
parents: 67
diff changeset
306 #undef FLT64_MIN_EXP
kono
parents: 67
diff changeset
307 #define FLT64_MIN_EXP __FLT64_MIN_EXP__
kono
parents: 67
diff changeset
308 #undef FLT64_MIN_10_EXP
kono
parents: 67
diff changeset
309 #define FLT64_MIN_10_EXP __FLT64_MIN_10_EXP__
kono
parents: 67
diff changeset
310 #undef FLT64_MAX_EXP
kono
parents: 67
diff changeset
311 #define FLT64_MAX_EXP __FLT64_MAX_EXP__
kono
parents: 67
diff changeset
312 #undef FLT64_MAX_10_EXP
kono
parents: 67
diff changeset
313 #define FLT64_MAX_10_EXP __FLT64_MAX_10_EXP__
kono
parents: 67
diff changeset
314 #undef FLT64_MAX
kono
parents: 67
diff changeset
315 #define FLT64_MAX __FLT64_MAX__
kono
parents: 67
diff changeset
316 #undef FLT64_EPSILON
kono
parents: 67
diff changeset
317 #define FLT64_EPSILON __FLT64_EPSILON__
kono
parents: 67
diff changeset
318 #undef FLT64_MIN
kono
parents: 67
diff changeset
319 #define FLT64_MIN __FLT64_MIN__
kono
parents: 67
diff changeset
320 #undef FLT64_DECIMAL_DIG
kono
parents: 67
diff changeset
321 #define FLT64_DECIMAL_DIG __FLT64_DECIMAL_DIG__
kono
parents: 67
diff changeset
322 #undef FLT64_TRUE_MIN
kono
parents: 67
diff changeset
323 #define FLT64_TRUE_MIN __FLT64_DENORM_MIN__
kono
parents: 67
diff changeset
324 #endif /* __FLT64_MANT_DIG__. */
kono
parents: 67
diff changeset
325
kono
parents: 67
diff changeset
326 #ifdef __FLT128_MANT_DIG__
kono
parents: 67
diff changeset
327 #undef FLT128_MANT_DIG
kono
parents: 67
diff changeset
328 #define FLT128_MANT_DIG __FLT128_MANT_DIG__
kono
parents: 67
diff changeset
329 #undef FLT128_DIG
kono
parents: 67
diff changeset
330 #define FLT128_DIG __FLT128_DIG__
kono
parents: 67
diff changeset
331 #undef FLT128_MIN_EXP
kono
parents: 67
diff changeset
332 #define FLT128_MIN_EXP __FLT128_MIN_EXP__
kono
parents: 67
diff changeset
333 #undef FLT128_MIN_10_EXP
kono
parents: 67
diff changeset
334 #define FLT128_MIN_10_EXP __FLT128_MIN_10_EXP__
kono
parents: 67
diff changeset
335 #undef FLT128_MAX_EXP
kono
parents: 67
diff changeset
336 #define FLT128_MAX_EXP __FLT128_MAX_EXP__
kono
parents: 67
diff changeset
337 #undef FLT128_MAX_10_EXP
kono
parents: 67
diff changeset
338 #define FLT128_MAX_10_EXP __FLT128_MAX_10_EXP__
kono
parents: 67
diff changeset
339 #undef FLT128_MAX
kono
parents: 67
diff changeset
340 #define FLT128_MAX __FLT128_MAX__
kono
parents: 67
diff changeset
341 #undef FLT128_EPSILON
kono
parents: 67
diff changeset
342 #define FLT128_EPSILON __FLT128_EPSILON__
kono
parents: 67
diff changeset
343 #undef FLT128_MIN
kono
parents: 67
diff changeset
344 #define FLT128_MIN __FLT128_MIN__
kono
parents: 67
diff changeset
345 #undef FLT128_DECIMAL_DIG
kono
parents: 67
diff changeset
346 #define FLT128_DECIMAL_DIG __FLT128_DECIMAL_DIG__
kono
parents: 67
diff changeset
347 #undef FLT128_TRUE_MIN
kono
parents: 67
diff changeset
348 #define FLT128_TRUE_MIN __FLT128_DENORM_MIN__
kono
parents: 67
diff changeset
349 #endif /* __FLT128_MANT_DIG__. */
kono
parents: 67
diff changeset
350
kono
parents: 67
diff changeset
351 #ifdef __FLT32X_MANT_DIG__
kono
parents: 67
diff changeset
352 #undef FLT32X_MANT_DIG
kono
parents: 67
diff changeset
353 #define FLT32X_MANT_DIG __FLT32X_MANT_DIG__
kono
parents: 67
diff changeset
354 #undef FLT32X_DIG
kono
parents: 67
diff changeset
355 #define FLT32X_DIG __FLT32X_DIG__
kono
parents: 67
diff changeset
356 #undef FLT32X_MIN_EXP
kono
parents: 67
diff changeset
357 #define FLT32X_MIN_EXP __FLT32X_MIN_EXP__
kono
parents: 67
diff changeset
358 #undef FLT32X_MIN_10_EXP
kono
parents: 67
diff changeset
359 #define FLT32X_MIN_10_EXP __FLT32X_MIN_10_EXP__
kono
parents: 67
diff changeset
360 #undef FLT32X_MAX_EXP
kono
parents: 67
diff changeset
361 #define FLT32X_MAX_EXP __FLT32X_MAX_EXP__
kono
parents: 67
diff changeset
362 #undef FLT32X_MAX_10_EXP
kono
parents: 67
diff changeset
363 #define FLT32X_MAX_10_EXP __FLT32X_MAX_10_EXP__
kono
parents: 67
diff changeset
364 #undef FLT32X_MAX
kono
parents: 67
diff changeset
365 #define FLT32X_MAX __FLT32X_MAX__
kono
parents: 67
diff changeset
366 #undef FLT32X_EPSILON
kono
parents: 67
diff changeset
367 #define FLT32X_EPSILON __FLT32X_EPSILON__
kono
parents: 67
diff changeset
368 #undef FLT32X_MIN
kono
parents: 67
diff changeset
369 #define FLT32X_MIN __FLT32X_MIN__
kono
parents: 67
diff changeset
370 #undef FLT32X_DECIMAL_DIG
kono
parents: 67
diff changeset
371 #define FLT32X_DECIMAL_DIG __FLT32X_DECIMAL_DIG__
kono
parents: 67
diff changeset
372 #undef FLT32X_TRUE_MIN
kono
parents: 67
diff changeset
373 #define FLT32X_TRUE_MIN __FLT32X_DENORM_MIN__
kono
parents: 67
diff changeset
374 #endif /* __FLT32X_MANT_DIG__. */
kono
parents: 67
diff changeset
375
kono
parents: 67
diff changeset
376 #ifdef __FLT64X_MANT_DIG__
kono
parents: 67
diff changeset
377 #undef FLT64X_MANT_DIG
kono
parents: 67
diff changeset
378 #define FLT64X_MANT_DIG __FLT64X_MANT_DIG__
kono
parents: 67
diff changeset
379 #undef FLT64X_DIG
kono
parents: 67
diff changeset
380 #define FLT64X_DIG __FLT64X_DIG__
kono
parents: 67
diff changeset
381 #undef FLT64X_MIN_EXP
kono
parents: 67
diff changeset
382 #define FLT64X_MIN_EXP __FLT64X_MIN_EXP__
kono
parents: 67
diff changeset
383 #undef FLT64X_MIN_10_EXP
kono
parents: 67
diff changeset
384 #define FLT64X_MIN_10_EXP __FLT64X_MIN_10_EXP__
kono
parents: 67
diff changeset
385 #undef FLT64X_MAX_EXP
kono
parents: 67
diff changeset
386 #define FLT64X_MAX_EXP __FLT64X_MAX_EXP__
kono
parents: 67
diff changeset
387 #undef FLT64X_MAX_10_EXP
kono
parents: 67
diff changeset
388 #define FLT64X_MAX_10_EXP __FLT64X_MAX_10_EXP__
kono
parents: 67
diff changeset
389 #undef FLT64X_MAX
kono
parents: 67
diff changeset
390 #define FLT64X_MAX __FLT64X_MAX__
kono
parents: 67
diff changeset
391 #undef FLT64X_EPSILON
kono
parents: 67
diff changeset
392 #define FLT64X_EPSILON __FLT64X_EPSILON__
kono
parents: 67
diff changeset
393 #undef FLT64X_MIN
kono
parents: 67
diff changeset
394 #define FLT64X_MIN __FLT64X_MIN__
kono
parents: 67
diff changeset
395 #undef FLT64X_DECIMAL_DIG
kono
parents: 67
diff changeset
396 #define FLT64X_DECIMAL_DIG __FLT64X_DECIMAL_DIG__
kono
parents: 67
diff changeset
397 #undef FLT64X_TRUE_MIN
kono
parents: 67
diff changeset
398 #define FLT64X_TRUE_MIN __FLT64X_DENORM_MIN__
kono
parents: 67
diff changeset
399 #endif /* __FLT64X_MANT_DIG__. */
kono
parents: 67
diff changeset
400
kono
parents: 67
diff changeset
401 #ifdef __FLT128X_MANT_DIG__
kono
parents: 67
diff changeset
402 #undef FLT128X_MANT_DIG
kono
parents: 67
diff changeset
403 #define FLT128X_MANT_DIG __FLT128X_MANT_DIG__
kono
parents: 67
diff changeset
404 #undef FLT128X_DIG
kono
parents: 67
diff changeset
405 #define FLT128X_DIG __FLT128X_DIG__
kono
parents: 67
diff changeset
406 #undef FLT128X_MIN_EXP
kono
parents: 67
diff changeset
407 #define FLT128X_MIN_EXP __FLT128X_MIN_EXP__
kono
parents: 67
diff changeset
408 #undef FLT128X_MIN_10_EXP
kono
parents: 67
diff changeset
409 #define FLT128X_MIN_10_EXP __FLT128X_MIN_10_EXP__
kono
parents: 67
diff changeset
410 #undef FLT128X_MAX_EXP
kono
parents: 67
diff changeset
411 #define FLT128X_MAX_EXP __FLT128X_MAX_EXP__
kono
parents: 67
diff changeset
412 #undef FLT128X_MAX_10_EXP
kono
parents: 67
diff changeset
413 #define FLT128X_MAX_10_EXP __FLT128X_MAX_10_EXP__
kono
parents: 67
diff changeset
414 #undef FLT128X_MAX
kono
parents: 67
diff changeset
415 #define FLT128X_MAX __FLT128X_MAX__
kono
parents: 67
diff changeset
416 #undef FLT128X_EPSILON
kono
parents: 67
diff changeset
417 #define FLT128X_EPSILON __FLT128X_EPSILON__
kono
parents: 67
diff changeset
418 #undef FLT128X_MIN
kono
parents: 67
diff changeset
419 #define FLT128X_MIN __FLT128X_MIN__
kono
parents: 67
diff changeset
420 #undef FLT128X_DECIMAL_DIG
kono
parents: 67
diff changeset
421 #define FLT128X_DECIMAL_DIG __FLT128X_DECIMAL_DIG__
kono
parents: 67
diff changeset
422 #undef FLT128X_TRUE_MIN
kono
parents: 67
diff changeset
423 #define FLT128X_TRUE_MIN __FLT128X_DENORM_MIN__
kono
parents: 67
diff changeset
424 #endif /* __FLT128X_MANT_DIG__. */
kono
parents: 67
diff changeset
425
kono
parents: 67
diff changeset
426 #endif /* __STDC_WANT_IEC_60559_TYPES_EXT__. */
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
427
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 #ifdef __STDC_WANT_DEC_FP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 /* Draft Technical Report 24732, extension for decimal floating-point
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 arithmetic: Characteristic of decimal floating types <float.h>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
431
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
432 /* Number of base-FLT_RADIX digits in the significand, p. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 #undef DEC32_MANT_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 #undef DEC64_MANT_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 #undef DEC128_MANT_DIG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436 #define DEC32_MANT_DIG __DEC32_MANT_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 #define DEC64_MANT_DIG __DEC64_MANT_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 #define DEC128_MANT_DIG __DEC128_MANT_DIG__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 /* Minimum exponent. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 #undef DEC32_MIN_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 #undef DEC64_MIN_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 #undef DEC128_MIN_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 #define DEC32_MIN_EXP __DEC32_MIN_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 #define DEC64_MIN_EXP __DEC64_MIN_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
446 #define DEC128_MIN_EXP __DEC128_MIN_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 /* Maximum exponent. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 #undef DEC32_MAX_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 #undef DEC64_MAX_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 #undef DEC128_MAX_EXP
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 #define DEC32_MAX_EXP __DEC32_MAX_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 #define DEC64_MAX_EXP __DEC64_MAX_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
454 #define DEC128_MAX_EXP __DEC128_MAX_EXP__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 /* Maximum representable finite decimal floating-point number
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 (there are 6, 15, and 33 9s after the decimal points respectively). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 #undef DEC32_MAX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 #undef DEC64_MAX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 #undef DEC128_MAX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 #define DEC32_MAX __DEC32_MAX__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 #define DEC64_MAX __DEC64_MAX__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 #define DEC128_MAX __DEC128_MAX__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 /* The difference between 1 and the least value greater than 1 that is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 representable in the given floating point type. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 #undef DEC32_EPSILON
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 #undef DEC64_EPSILON
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 #undef DEC128_EPSILON
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 #define DEC32_EPSILON __DEC32_EPSILON__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 #define DEC64_EPSILON __DEC64_EPSILON__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472 #define DEC128_EPSILON __DEC128_EPSILON__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 /* Minimum normalized positive floating-point number. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 #undef DEC32_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 #undef DEC64_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 #undef DEC128_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 #define DEC32_MIN __DEC32_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 #define DEC64_MIN __DEC64_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 #define DEC128_MIN __DEC128_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 /* Minimum subnormal positive floating-point number. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 #undef DEC32_SUBNORMAL_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 #undef DEC64_SUBNORMAL_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485 #undef DEC128_SUBNORMAL_MIN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 #define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 #define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488 #define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 /* The floating-point expression evaluation method.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 -1 indeterminate
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 0 evaluate all operations and constants just to the range and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 precision of the type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 1 evaluate operations and constants of type _Decimal32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 and _Decimal64 to the range and precision of the _Decimal64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 type, evaluate _Decimal128 operations and constants to the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 range and precision of the _Decimal128 type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
498 2 evaluate all operations and constants to the range and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499 precision of the _Decimal128 type. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 #undef DEC_EVAL_METHOD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 #define DEC_EVAL_METHOD __DEC_EVAL_METHOD__
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
503
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 #endif /* __STDC_WANT_DEC_FP__ */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 #endif /* _FLOAT_H___ */