Remove _Mlong_double_ etc. macros.
[glibc.git] / math / math.h
blob88fd4bce54da24ecd0b0602a2410b7dd098d1b90
1 /* Declarations for math functions.
2 Copyright (C) 1991-2017 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
20 * ISO C99 Standard: 7.12 Mathematics <math.h>
23 #ifndef _MATH_H
24 #define _MATH_H 1
26 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION
27 #include <bits/libc-header-start.h>
29 #if defined log && defined __GNUC__
30 # warning A macro called log was already defined when <math.h> was included.
31 # warning This will cause compilation problems.
32 #endif
34 __BEGIN_DECLS
36 /* Get definitions of __intmax_t and __uintmax_t. */
37 #include <bits/types.h>
39 /* Get machine-dependent vector math functions declarations. */
40 #include <bits/math-vector.h>
42 /* Gather machine dependent type support. */
43 #include <bits/floatn.h>
45 /* Value returned on overflow. With IEEE 754 floating point, this is
46 +Infinity, otherwise the largest representable positive value. */
47 #if __GNUC_PREREQ (3, 3)
48 # define HUGE_VAL (__builtin_huge_val ())
49 #else
50 /* This may provoke compiler warnings, and may not be rounded to
51 +Infinity in all IEEE 754 rounding modes, but is the best that can
52 be done in ISO C while remaining a constant expression. 10,000 is
53 greater than the maximum (decimal) exponent for all supported
54 floating-point formats and widths. */
55 # define HUGE_VAL 1e10000
56 #endif
57 #ifdef __USE_ISOC99
58 # if __GNUC_PREREQ (3, 3)
59 # define HUGE_VALF (__builtin_huge_valf ())
60 # define HUGE_VALL (__builtin_huge_vall ())
61 # else
62 # define HUGE_VALF 1e10000f
63 # define HUGE_VALL 1e10000L
64 # endif
65 #endif
66 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
67 # define HUGE_VAL_F16 (__builtin_huge_valf16 ())
68 #endif
69 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
70 # define HUGE_VAL_F32 (__builtin_huge_valf32 ())
71 #endif
72 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
73 # define HUGE_VAL_F64 (__builtin_huge_valf64 ())
74 #endif
75 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
76 # define HUGE_VAL_F128 (__builtin_huge_valf128 ())
77 #endif
78 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
79 # define HUGE_VAL_F32X (__builtin_huge_valf32x ())
80 #endif
81 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
82 # define HUGE_VAL_F64X (__builtin_huge_valf64x ())
83 #endif
84 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
85 # define HUGE_VAL_F128X (__builtin_huge_valf128x ())
86 #endif
88 #ifdef __USE_ISOC99
89 /* IEEE positive infinity. */
90 # if __GNUC_PREREQ (3, 3)
91 # define INFINITY (__builtin_inff ())
92 # else
93 # define INFINITY HUGE_VALF
94 # endif
96 /* IEEE Not A Number. */
97 # if __GNUC_PREREQ (3, 3)
98 # define NAN (__builtin_nanf (""))
99 # else
100 /* This will raise an "invalid" exception outside static initializers,
101 but is the best that can be done in ISO C while remaining a
102 constant expression. */
103 # define NAN (0.0f / 0.0f)
104 # endif
105 #endif /* __USE_ISOC99 */
107 #if __GLIBC_USE (IEC_60559_BFP_EXT)
108 /* Signaling NaN macros, if supported. */
109 # if __GNUC_PREREQ (3, 3)
110 # define SNANF (__builtin_nansf (""))
111 # define SNAN (__builtin_nans (""))
112 # define SNANL (__builtin_nansl (""))
113 # endif
114 #endif
115 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
116 # define SNANF16 (__builtin_nansf16 (""))
117 #endif
118 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
119 # define SNANF32 (__builtin_nansf32 (""))
120 #endif
121 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
122 # define SNANF64 (__builtin_nansf64 (""))
123 #endif
124 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
125 # define SNANF128 (__builtin_nansf128 (""))
126 #endif
127 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
128 # define SNANF32X (__builtin_nansf32x (""))
129 #endif
130 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
131 # define SNANF64X (__builtin_nansf64x (""))
132 #endif
133 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
134 # define SNANF128X (__builtin_nansf128x (""))
135 #endif
137 /* Get __GLIBC_FLT_EVAL_METHOD. */
138 #include <bits/flt-eval-method.h>
140 #ifdef __USE_ISOC99
141 /* Define the following typedefs.
143 float_t floating-point type at least as wide as `float' used
144 to evaluate `float' expressions
145 double_t floating-point type at least as wide as `double' used
146 to evaluate `double' expressions
148 # if __GLIBC_FLT_EVAL_METHOD == 0 || __GLIBC_FLT_EVAL_METHOD == 16
149 typedef float float_t;
150 typedef double double_t;
151 # elif __GLIBC_FLT_EVAL_METHOD == 1
152 typedef double float_t;
153 typedef double double_t;
154 # elif __GLIBC_FLT_EVAL_METHOD == 2
155 typedef long double float_t;
156 typedef long double double_t;
157 # elif __GLIBC_FLT_EVAL_METHOD == 32
158 typedef _Float32 float_t;
159 typedef double double_t;
160 # elif __GLIBC_FLT_EVAL_METHOD == 33
161 typedef _Float32x float_t;
162 typedef _Float32x double_t;
163 # elif __GLIBC_FLT_EVAL_METHOD == 64
164 typedef _Float64 float_t;
165 typedef _Float64 double_t;
166 # elif __GLIBC_FLT_EVAL_METHOD == 65
167 typedef _Float64x float_t;
168 typedef _Float64x double_t;
169 # elif __GLIBC_FLT_EVAL_METHOD == 128
170 typedef _Float128 float_t;
171 typedef _Float128 double_t;
172 # elif __GLIBC_FLT_EVAL_METHOD == 129
173 typedef _Float128x float_t;
174 typedef _Float128x double_t;
175 # else
176 # error "Unknown __GLIBC_FLT_EVAL_METHOD"
177 # endif
178 #endif
180 /* Define macros for the return values of ilogb and llogb, based on
181 __FP_LOGB0_IS_MIN and __FP_LOGBNAN_IS_MIN.
183 FP_ILOGB0 Expands to a value returned by `ilogb (0.0)'.
184 FP_ILOGBNAN Expands to a value returned by `ilogb (NAN)'.
185 FP_LLOGB0 Expands to a value returned by `llogb (0.0)'.
186 FP_LLOGBNAN Expands to a value returned by `llogb (NAN)'.
190 #include <bits/fp-logb.h>
191 #ifdef __USE_ISOC99
192 # if __FP_LOGB0_IS_MIN
193 # define FP_ILOGB0 (-2147483647 - 1)
194 # else
195 # define FP_ILOGB0 (-2147483647)
196 # endif
197 # if __FP_LOGBNAN_IS_MIN
198 # define FP_ILOGBNAN (-2147483647 - 1)
199 # else
200 # define FP_ILOGBNAN 2147483647
201 # endif
202 #endif
203 #if __GLIBC_USE (IEC_60559_BFP_EXT)
204 # if __WORDSIZE == 32
205 # define __FP_LONG_MAX 0x7fffffffL
206 # else
207 # define __FP_LONG_MAX 0x7fffffffffffffffL
208 # endif
209 # if __FP_LOGB0_IS_MIN
210 # define FP_LLOGB0 (-__FP_LONG_MAX - 1)
211 # else
212 # define FP_LLOGB0 (-__FP_LONG_MAX)
213 # endif
214 # if __FP_LOGBNAN_IS_MIN
215 # define FP_LLOGBNAN (-__FP_LONG_MAX - 1)
216 # else
217 # define FP_LLOGBNAN __FP_LONG_MAX
218 # endif
219 #endif
221 /* Get the architecture specific values describing the floating-point
222 evaluation. The following symbols will get defined:
224 FP_FAST_FMA
225 FP_FAST_FMAF
226 FP_FAST_FMAL
227 If defined it indicates that the `fma' function
228 generally executes about as fast as a multiply and an add.
229 This macro is defined only iff the `fma' function is
230 implemented directly with a hardware multiply-add instructions.
233 #include <bits/fp-fast.h>
235 #if __GLIBC_USE (IEC_60559_BFP_EXT)
236 /* Rounding direction macros for fromfp functions. */
237 enum
239 FP_INT_UPWARD =
240 # define FP_INT_UPWARD 0
241 FP_INT_UPWARD,
242 FP_INT_DOWNWARD =
243 # define FP_INT_DOWNWARD 1
244 FP_INT_DOWNWARD,
245 FP_INT_TOWARDZERO =
246 # define FP_INT_TOWARDZERO 2
247 FP_INT_TOWARDZERO,
248 FP_INT_TONEARESTFROMZERO =
249 # define FP_INT_TONEARESTFROMZERO 3
250 FP_INT_TONEARESTFROMZERO,
251 FP_INT_TONEAREST =
252 # define FP_INT_TONEAREST 4
253 FP_INT_TONEAREST,
255 #endif
257 /* The file <bits/mathcalls.h> contains the prototypes for all the
258 actual math functions. These macros are used for those prototypes,
259 so we can easily declare each function as both `name' and `__name',
260 and can declare the float versions `namef' and `__namef'. */
262 #define __SIMD_DECL(function) __CONCAT (__DECL_SIMD_, function)
264 #define __MATHCALL_VEC(function, suffix, args) \
265 __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \
266 __MATHCALL (function, suffix, args)
268 #define __MATHDECL_VEC(type, function,suffix, args) \
269 __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \
270 __MATHDECL(type, function,suffix, args)
272 #define __MATHCALL(function,suffix, args) \
273 __MATHDECL (_Mdouble_,function,suffix, args)
274 #define __MATHDECL(type, function,suffix, args) \
275 __MATHDECL_1(type, function,suffix, args); \
276 __MATHDECL_1(type, __CONCAT(__,function),suffix, args)
277 #define __MATHCALLX(function,suffix, args, attrib) \
278 __MATHDECLX (_Mdouble_,function,suffix, args, attrib)
279 #define __MATHDECLX(type, function,suffix, args, attrib) \
280 __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
281 __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib)
282 #define __MATHDECL_1(type, function,suffix, args) \
283 extern type __MATH_PRECNAME(function,suffix) args __THROW
285 #define _Mdouble_ double
286 #define __MATH_PRECNAME(name,r) __CONCAT(name,r)
287 #define __MATH_DECLARING_DOUBLE 1
288 #define __MATH_DECLARING_FLOATN 0
289 #include <bits/mathcalls-helper-functions.h>
290 #include <bits/mathcalls.h>
291 #undef _Mdouble_
292 #undef __MATH_PRECNAME
293 #undef __MATH_DECLARING_DOUBLE
294 #undef __MATH_DECLARING_FLOATN
296 #ifdef __USE_ISOC99
299 /* Include the file of declarations again, this time using `float'
300 instead of `double' and appending f to each function name. */
302 # define _Mdouble_ float
303 # define __MATH_PRECNAME(name,r) name##f##r
304 # define __MATH_DECLARING_DOUBLE 0
305 # define __MATH_DECLARING_FLOATN 0
306 # include <bits/mathcalls-helper-functions.h>
307 # include <bits/mathcalls.h>
308 # undef _Mdouble_
309 # undef __MATH_PRECNAME
310 # undef __MATH_DECLARING_DOUBLE
311 # undef __MATH_DECLARING_FLOATN
313 # if !(defined __NO_LONG_DOUBLE_MATH && defined _LIBC) \
314 || defined __LDBL_COMPAT \
315 || defined _LIBC_TEST
316 # ifdef __LDBL_COMPAT
318 # ifdef __USE_ISOC99
319 extern float __nldbl_nexttowardf (float __x, long double __y)
320 __THROW __attribute__ ((__const__));
321 # ifdef __REDIRECT_NTH
322 extern float __REDIRECT_NTH (nexttowardf, (float __x, long double __y),
323 __nldbl_nexttowardf)
324 __attribute__ ((__const__));
325 extern double __REDIRECT_NTH (nexttoward, (double __x, long double __y),
326 nextafter) __attribute__ ((__const__));
327 extern long double __REDIRECT_NTH (nexttowardl,
328 (long double __x, long double __y),
329 nextafter) __attribute__ ((__const__));
330 # endif
331 # endif
333 # undef __MATHDECL_1
334 # define __MATHDECL_2(type, function,suffix, args, alias) \
335 extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \
336 args, alias)
337 # define __MATHDECL_1(type, function,suffix, args) \
338 __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix))
339 # endif
341 /* Include the file of declarations again, this time using `long double'
342 instead of `double' and appending l to each function name. */
344 # define _Mdouble_ long double
345 # define __MATH_PRECNAME(name,r) name##l##r
346 # define __MATH_DECLARING_DOUBLE 0
347 # define __MATH_DECLARING_FLOATN 0
348 # define __MATH_DECLARE_LDOUBLE 1
349 # include <bits/mathcalls-helper-functions.h>
350 # include <bits/mathcalls.h>
351 # undef _Mdouble_
352 # undef __MATH_PRECNAME
353 # undef __MATH_DECLARING_DOUBLE
354 # undef __MATH_DECLARING_FLOATN
356 # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */
358 #endif /* Use ISO C99. */
360 /* Include the file of declarations for _FloatN and _FloatNx
361 types. */
363 #if __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !defined _LIBC)
364 # define _Mdouble_ _Float16
365 # define __MATH_PRECNAME(name,r) name##f16##r
366 # define __MATH_DECLARING_DOUBLE 0
367 # define __MATH_DECLARING_FLOATN 1
368 # if __HAVE_DISTINCT_FLOAT16
369 # include <bits/mathcalls-helper-functions.h>
370 # endif
371 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
372 # include <bits/mathcalls.h>
373 # endif
374 # undef _Mdouble_
375 # undef __MATH_PRECNAME
376 # undef __MATH_DECLARING_DOUBLE
377 # undef __MATH_DECLARING_FLOATN
378 #endif /* __HAVE_DISTINCT_FLOAT16 || (__HAVE_FLOAT16 && !_LIBC). */
380 #if __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !defined _LIBC)
381 # define _Mdouble_ _Float32
382 # define __MATH_PRECNAME(name,r) name##f32##r
383 # define __MATH_DECLARING_DOUBLE 0
384 # define __MATH_DECLARING_FLOATN 1
385 # if __HAVE_DISTINCT_FLOAT32
386 # include <bits/mathcalls-helper-functions.h>
387 # endif
388 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
389 # include <bits/mathcalls.h>
390 # endif
391 # undef _Mdouble_
392 # undef __MATH_PRECNAME
393 # undef __MATH_DECLARING_DOUBLE
394 # undef __MATH_DECLARING_FLOATN
395 #endif /* __HAVE_DISTINCT_FLOAT32 || (__HAVE_FLOAT32 && !_LIBC). */
397 #if __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !defined _LIBC)
398 # define _Mdouble_ _Float64
399 # define __MATH_PRECNAME(name,r) name##f64##r
400 # define __MATH_DECLARING_DOUBLE 0
401 # define __MATH_DECLARING_FLOATN 1
402 # if __HAVE_DISTINCT_FLOAT64
403 # include <bits/mathcalls-helper-functions.h>
404 # endif
405 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
406 # include <bits/mathcalls.h>
407 # endif
408 # undef _Mdouble_
409 # undef __MATH_PRECNAME
410 # undef __MATH_DECLARING_DOUBLE
411 # undef __MATH_DECLARING_FLOATN
412 #endif /* __HAVE_DISTINCT_FLOAT64 || (__HAVE_FLOAT64 && !_LIBC). */
414 #if __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)
415 # define _Mdouble_ _Float128
416 # define __MATH_PRECNAME(name,r) name##f128##r
417 # define __MATH_DECLARING_DOUBLE 0
418 # define __MATH_DECLARING_FLOATN 1
419 # if __HAVE_DISTINCT_FLOAT128
420 # include <bits/mathcalls-helper-functions.h>
421 # endif
422 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
423 # include <bits/mathcalls.h>
424 # endif
425 # undef _Mdouble_
426 # undef __MATH_PRECNAME
427 # undef __MATH_DECLARING_DOUBLE
428 # undef __MATH_DECLARING_FLOATN
429 #endif /* __HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !_LIBC). */
431 #if __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !defined _LIBC)
432 # define _Mdouble_ _Float32x
433 # define __MATH_PRECNAME(name,r) name##f32x##r
434 # define __MATH_DECLARING_DOUBLE 0
435 # define __MATH_DECLARING_FLOATN 1
436 # if __HAVE_DISTINCT_FLOAT32X
437 # include <bits/mathcalls-helper-functions.h>
438 # endif
439 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
440 # include <bits/mathcalls.h>
441 # endif
442 # undef _Mdouble_
443 # undef __MATH_PRECNAME
444 # undef __MATH_DECLARING_DOUBLE
445 # undef __MATH_DECLARING_FLOATN
446 #endif /* __HAVE_DISTINCT_FLOAT32X || (__HAVE_FLOAT32X && !_LIBC). */
448 #if __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !defined _LIBC)
449 # define _Mdouble_ _Float64x
450 # define __MATH_PRECNAME(name,r) name##f64x##r
451 # define __MATH_DECLARING_DOUBLE 0
452 # define __MATH_DECLARING_FLOATN 1
453 # if __HAVE_DISTINCT_FLOAT64X
454 # include <bits/mathcalls-helper-functions.h>
455 # endif
456 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
457 # include <bits/mathcalls.h>
458 # endif
459 # undef _Mdouble_
460 # undef __MATH_PRECNAME
461 # undef __MATH_DECLARING_DOUBLE
462 # undef __MATH_DECLARING_FLOATN
463 #endif /* __HAVE_DISTINCT_FLOAT64X || (__HAVE_FLOAT64X && !_LIBC). */
465 #if __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !defined _LIBC)
466 # define _Mdouble_ _Float128x
467 # define __MATH_PRECNAME(name,r) name##f128x##r
468 # define __MATH_DECLARING_DOUBLE 0
469 # define __MATH_DECLARING_FLOATN 1
470 # if __HAVE_DISTINCT_FLOAT128X
471 # include <bits/mathcalls-helper-functions.h>
472 # endif
473 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
474 # include <bits/mathcalls.h>
475 # endif
476 # undef _Mdouble_
477 # undef __MATH_PRECNAME
478 # undef __MATH_DECLARING_DOUBLE
479 # undef __MATH_DECLARING_FLOATN
480 #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */
482 #undef __MATHDECL_1
483 #undef __MATHDECL
484 #undef __MATHCALL
487 #if defined __USE_MISC || defined __USE_XOPEN
488 /* This variable is used by `gamma' and `lgamma'. */
489 extern int signgam;
490 #endif
493 /* Depending on the type of TG_ARG, call an appropriately suffixed
494 version of FUNC with arguments (including parentheses) ARGS.
495 Suffixed functions may not exist for long double if it has the same
496 format as double, or for other types with the same format as float,
497 double or long double. The behavior is undefined if the argument
498 does not have a real floating type. The definition may use a
499 conditional expression, so all suffixed versions of FUNC must
500 return the same type (FUNC may include a cast if necessary rather
501 than being a single identifier). */
502 #ifdef __NO_LONG_DOUBLE_MATH
503 # define __MATH_TG(TG_ARG, FUNC, ARGS) \
504 (sizeof (TG_ARG) == sizeof (float) ? FUNC ## f ARGS : FUNC ARGS)
505 #elif __HAVE_DISTINCT_FLOAT128
506 # if __HAVE_GENERIC_SELECTION
507 # define __MATH_TG(TG_ARG, FUNC, ARGS) \
508 _Generic ((TG_ARG), \
509 float: FUNC ## f ARGS, \
510 default: FUNC ARGS, \
511 long double: FUNC ## l ARGS, \
512 _Float128: FUNC ## f128 ARGS)
513 # else
514 # define __MATH_TG(TG_ARG, FUNC, ARGS) \
515 __builtin_choose_expr \
516 (__builtin_types_compatible_p (__typeof (TG_ARG), float), \
517 FUNC ## f ARGS, \
518 __builtin_choose_expr \
519 (__builtin_types_compatible_p (__typeof (TG_ARG), double), \
520 FUNC ARGS, \
521 __builtin_choose_expr \
522 (__builtin_types_compatible_p (__typeof (TG_ARG), long double), \
523 FUNC ## l ARGS, \
524 FUNC ## f128 ARGS)))
525 # endif
526 #else
527 # define __MATH_TG(TG_ARG, FUNC, ARGS) \
528 (sizeof (TG_ARG) == sizeof (float) \
529 ? FUNC ## f ARGS \
530 : sizeof (TG_ARG) == sizeof (double) \
531 ? FUNC ARGS \
532 : FUNC ## l ARGS)
533 #endif
535 /* ISO C99 defines some generic macros which work on any data type. */
536 #ifdef __USE_ISOC99
538 /* All floating-point numbers can be put in one of these categories. */
539 enum
541 FP_NAN =
542 # define FP_NAN 0
543 FP_NAN,
544 FP_INFINITE =
545 # define FP_INFINITE 1
546 FP_INFINITE,
547 FP_ZERO =
548 # define FP_ZERO 2
549 FP_ZERO,
550 FP_SUBNORMAL =
551 # define FP_SUBNORMAL 3
552 FP_SUBNORMAL,
553 FP_NORMAL =
554 # define FP_NORMAL 4
555 FP_NORMAL
558 /* GCC bug 66462 means we cannot use the math builtins with -fsignaling-nan,
559 so disable builtins if this is enabled. When fixed in a newer GCC,
560 the __SUPPORT_SNAN__ check may be skipped for those versions. */
562 /* Return number of classification appropriate for X. */
563 # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__ \
564 && (!defined __OPTIMIZE_SIZE__ || defined __cplusplus)
565 /* The check for __cplusplus allows the use of the builtin, even
566 when optimization for size is on. This is provided for
567 libstdc++, only to let its configure test work when it is built
568 with -Os. No further use of this definition of fpclassify is
569 expected in C++ mode, since libstdc++ provides its own version
570 of fpclassify in cmath (which undefines fpclassify). */
571 # define fpclassify(x) __builtin_fpclassify (FP_NAN, FP_INFINITE, \
572 FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x)
573 # else
574 # define fpclassify(x) __MATH_TG ((x), __fpclassify, (x))
575 # endif
577 /* Return nonzero value if sign of X is negative. */
578 # if __GNUC_PREREQ (6,0)
579 # define signbit(x) __builtin_signbit (x)
580 # elif defined __cplusplus
581 /* In C++ mode, __MATH_TG cannot be used, because it relies on
582 __builtin_types_compatible_p, which is a C-only builtin.
583 The check for __cplusplus allows the use of the builtin instead of
584 __MATH_TG. This is provided for libstdc++, only to let its configure
585 test work. No further use of this definition of signbit is expected
586 in C++ mode, since libstdc++ provides its own version of signbit
587 in cmath (which undefines signbit). */
588 # define signbit(x) __builtin_signbitl (x)
589 # elif __GNUC_PREREQ (4,0)
590 # define signbit(x) __MATH_TG ((x), __builtin_signbit, (x))
591 # else
592 # define signbit(x) __MATH_TG ((x), __signbit, (x))
593 # endif
595 /* Return nonzero value if X is not +-Inf or NaN. */
596 # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
597 # define isfinite(x) __builtin_isfinite (x)
598 # else
599 # define isfinite(x) __MATH_TG ((x), __finite, (x))
600 # endif
602 /* Return nonzero value if X is neither zero, subnormal, Inf, nor NaN. */
603 # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
604 # define isnormal(x) __builtin_isnormal (x)
605 # else
606 # define isnormal(x) (fpclassify (x) == FP_NORMAL)
607 # endif
609 /* Return nonzero value if X is a NaN. We could use `fpclassify' but
610 we already have this functions `__isnan' and it is faster. */
611 # if __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
612 # define isnan(x) __builtin_isnan (x)
613 # else
614 # define isnan(x) __MATH_TG ((x), __isnan, (x))
615 # endif
617 /* Return nonzero value if X is positive or negative infinity. */
618 # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
619 && !defined __SUPPORT_SNAN__ && !defined __cplusplus
620 /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
621 use the helper function, __isinff128, with older compilers. This is
622 only provided for C mode, because in C++ mode, GCC has no support
623 for __builtin_types_compatible_p (and when in C++ mode, this macro is
624 not used anyway, because libstdc++ headers undefine it). */
625 # define isinf(x) \
626 (__builtin_types_compatible_p (__typeof (x), _Float128) \
627 ? __isinff128 (x) : __builtin_isinf_sign (x))
628 # elif __GNUC_PREREQ (4,4) && !defined __SUPPORT_SNAN__
629 # define isinf(x) __builtin_isinf_sign (x)
630 # else
631 # define isinf(x) __MATH_TG ((x), __isinf, (x))
632 # endif
634 /* Bitmasks for the math_errhandling macro. */
635 # define MATH_ERRNO 1 /* errno set by math functions. */
636 # define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */
638 /* By default all functions support both errno and exception handling.
639 In gcc's fast math mode and if inline functions are defined this
640 might not be true. */
641 # ifndef __FAST_MATH__
642 # define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT)
643 # endif
645 #endif /* Use ISO C99. */
647 #if __GLIBC_USE (IEC_60559_BFP_EXT)
648 # include <bits/iscanonical.h>
650 /* Return nonzero value if X is a signaling NaN. */
651 # ifndef __cplusplus
652 # define issignaling(x) __MATH_TG ((x), __issignaling, (x))
653 # else
654 /* In C++ mode, __MATH_TG cannot be used, because it relies on
655 __builtin_types_compatible_p, which is a C-only builtin. On the
656 other hand, overloading provides the means to distinguish between
657 the floating-point types. The overloading resolution will match
658 the correct parameter (regardless of type qualifiers (i.e.: const
659 and volatile)). */
660 extern "C++" {
661 inline int issignaling (float __val) { return __issignalingf (__val); }
662 inline int issignaling (double __val) { return __issignaling (__val); }
663 inline int
664 issignaling (long double __val)
666 # ifdef __NO_LONG_DOUBLE_MATH
667 return __issignaling (__val);
668 # else
669 return __issignalingl (__val);
670 # endif
672 # if __HAVE_DISTINCT_FLOAT128
673 inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
674 # endif
675 } /* extern C++ */
676 # endif
678 /* Return nonzero value if X is subnormal. */
679 # define issubnormal(x) (fpclassify (x) == FP_SUBNORMAL)
681 /* Return nonzero value if X is zero. */
682 # ifndef __cplusplus
683 # ifdef __SUPPORT_SNAN__
684 # define iszero(x) (fpclassify (x) == FP_ZERO)
685 # else
686 # define iszero(x) (((__typeof (x)) (x)) == 0)
687 # endif
688 # else /* __cplusplus */
689 extern "C++" {
690 # ifdef __SUPPORT_SNAN__
691 inline int
692 iszero (float __val)
694 return __fpclassifyf (__val) == FP_ZERO;
696 inline int
697 iszero (double __val)
699 return __fpclassify (__val) == FP_ZERO;
701 inline int
702 iszero (long double __val)
704 # ifdef __NO_LONG_DOUBLE_MATH
705 return __fpclassify (__val) == FP_ZERO;
706 # else
707 return __fpclassifyl (__val) == FP_ZERO;
708 # endif
710 # if __HAVE_DISTINCT_FLOAT128
711 inline int
712 iszero (_Float128 __val)
714 return __fpclassifyf128 (__val) == FP_ZERO;
716 # endif
717 # else
718 template <class __T> inline bool
719 iszero (__T __val)
721 return __val == 0;
723 # endif
724 } /* extern C++ */
725 # endif /* __cplusplus */
726 #endif /* Use IEC_60559_BFP_EXT. */
728 #ifdef __USE_XOPEN
729 /* X/Open wants another strange constant. */
730 # define MAXFLOAT 3.40282347e+38F
731 #endif
734 /* Some useful constants. */
735 #if defined __USE_MISC || defined __USE_XOPEN
736 # define M_E 2.7182818284590452354 /* e */
737 # define M_LOG2E 1.4426950408889634074 /* log_2 e */
738 # define M_LOG10E 0.43429448190325182765 /* log_10 e */
739 # define M_LN2 0.69314718055994530942 /* log_e 2 */
740 # define M_LN10 2.30258509299404568402 /* log_e 10 */
741 # define M_PI 3.14159265358979323846 /* pi */
742 # define M_PI_2 1.57079632679489661923 /* pi/2 */
743 # define M_PI_4 0.78539816339744830962 /* pi/4 */
744 # define M_1_PI 0.31830988618379067154 /* 1/pi */
745 # define M_2_PI 0.63661977236758134308 /* 2/pi */
746 # define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
747 # define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
748 # define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
749 #endif
751 /* The above constants are not adequate for computation using `long double's.
752 Therefore we provide as an extension constants with similar names as a
753 GNU extension. Provide enough digits for the 128-bit IEEE quad. */
754 #ifdef __USE_GNU
755 # define M_El 2.718281828459045235360287471352662498L /* e */
756 # define M_LOG2El 1.442695040888963407359924681001892137L /* log_2 e */
757 # define M_LOG10El 0.434294481903251827651128918916605082L /* log_10 e */
758 # define M_LN2l 0.693147180559945309417232121458176568L /* log_e 2 */
759 # define M_LN10l 2.302585092994045684017991454684364208L /* log_e 10 */
760 # define M_PIl 3.141592653589793238462643383279502884L /* pi */
761 # define M_PI_2l 1.570796326794896619231321691639751442L /* pi/2 */
762 # define M_PI_4l 0.785398163397448309615660845819875721L /* pi/4 */
763 # define M_1_PIl 0.318309886183790671537767526745028724L /* 1/pi */
764 # define M_2_PIl 0.636619772367581343075535053490057448L /* 2/pi */
765 # define M_2_SQRTPIl 1.128379167095512573896158903121545172L /* 2/sqrt(pi) */
766 # define M_SQRT2l 1.414213562373095048801688724209698079L /* sqrt(2) */
767 # define M_SQRT1_2l 0.707106781186547524400844362104849039L /* 1/sqrt(2) */
768 #endif
770 #if __HAVE_FLOAT16 && defined __USE_GNU
771 # define M_Ef16 __f16 (2.718281828459045235360287471352662498) /* e */
772 # define M_LOG2Ef16 __f16 (1.442695040888963407359924681001892137) /* log_2 e */
773 # define M_LOG10Ef16 __f16 (0.434294481903251827651128918916605082) /* log_10 e */
774 # define M_LN2f16 __f16 (0.693147180559945309417232121458176568) /* log_e 2 */
775 # define M_LN10f16 __f16 (2.302585092994045684017991454684364208) /* log_e 10 */
776 # define M_PIf16 __f16 (3.141592653589793238462643383279502884) /* pi */
777 # define M_PI_2f16 __f16 (1.570796326794896619231321691639751442) /* pi/2 */
778 # define M_PI_4f16 __f16 (0.785398163397448309615660845819875721) /* pi/4 */
779 # define M_1_PIf16 __f16 (0.318309886183790671537767526745028724) /* 1/pi */
780 # define M_2_PIf16 __f16 (0.636619772367581343075535053490057448) /* 2/pi */
781 # define M_2_SQRTPIf16 __f16 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
782 # define M_SQRT2f16 __f16 (1.414213562373095048801688724209698079) /* sqrt(2) */
783 # define M_SQRT1_2f16 __f16 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
784 #endif
786 #if __HAVE_FLOAT32 && defined __USE_GNU
787 # define M_Ef32 __f32 (2.718281828459045235360287471352662498) /* e */
788 # define M_LOG2Ef32 __f32 (1.442695040888963407359924681001892137) /* log_2 e */
789 # define M_LOG10Ef32 __f32 (0.434294481903251827651128918916605082) /* log_10 e */
790 # define M_LN2f32 __f32 (0.693147180559945309417232121458176568) /* log_e 2 */
791 # define M_LN10f32 __f32 (2.302585092994045684017991454684364208) /* log_e 10 */
792 # define M_PIf32 __f32 (3.141592653589793238462643383279502884) /* pi */
793 # define M_PI_2f32 __f32 (1.570796326794896619231321691639751442) /* pi/2 */
794 # define M_PI_4f32 __f32 (0.785398163397448309615660845819875721) /* pi/4 */
795 # define M_1_PIf32 __f32 (0.318309886183790671537767526745028724) /* 1/pi */
796 # define M_2_PIf32 __f32 (0.636619772367581343075535053490057448) /* 2/pi */
797 # define M_2_SQRTPIf32 __f32 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
798 # define M_SQRT2f32 __f32 (1.414213562373095048801688724209698079) /* sqrt(2) */
799 # define M_SQRT1_2f32 __f32 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
800 #endif
802 #if __HAVE_FLOAT64 && defined __USE_GNU
803 # define M_Ef64 __f64 (2.718281828459045235360287471352662498) /* e */
804 # define M_LOG2Ef64 __f64 (1.442695040888963407359924681001892137) /* log_2 e */
805 # define M_LOG10Ef64 __f64 (0.434294481903251827651128918916605082) /* log_10 e */
806 # define M_LN2f64 __f64 (0.693147180559945309417232121458176568) /* log_e 2 */
807 # define M_LN10f64 __f64 (2.302585092994045684017991454684364208) /* log_e 10 */
808 # define M_PIf64 __f64 (3.141592653589793238462643383279502884) /* pi */
809 # define M_PI_2f64 __f64 (1.570796326794896619231321691639751442) /* pi/2 */
810 # define M_PI_4f64 __f64 (0.785398163397448309615660845819875721) /* pi/4 */
811 # define M_1_PIf64 __f64 (0.318309886183790671537767526745028724) /* 1/pi */
812 # define M_2_PIf64 __f64 (0.636619772367581343075535053490057448) /* 2/pi */
813 # define M_2_SQRTPIf64 __f64 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
814 # define M_SQRT2f64 __f64 (1.414213562373095048801688724209698079) /* sqrt(2) */
815 # define M_SQRT1_2f64 __f64 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
816 #endif
818 #if __HAVE_FLOAT128 && defined __USE_GNU
819 # define M_Ef128 __f128 (2.718281828459045235360287471352662498) /* e */
820 # define M_LOG2Ef128 __f128 (1.442695040888963407359924681001892137) /* log_2 e */
821 # define M_LOG10Ef128 __f128 (0.434294481903251827651128918916605082) /* log_10 e */
822 # define M_LN2f128 __f128 (0.693147180559945309417232121458176568) /* log_e 2 */
823 # define M_LN10f128 __f128 (2.302585092994045684017991454684364208) /* log_e 10 */
824 # define M_PIf128 __f128 (3.141592653589793238462643383279502884) /* pi */
825 # define M_PI_2f128 __f128 (1.570796326794896619231321691639751442) /* pi/2 */
826 # define M_PI_4f128 __f128 (0.785398163397448309615660845819875721) /* pi/4 */
827 # define M_1_PIf128 __f128 (0.318309886183790671537767526745028724) /* 1/pi */
828 # define M_2_PIf128 __f128 (0.636619772367581343075535053490057448) /* 2/pi */
829 # define M_2_SQRTPIf128 __f128 (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
830 # define M_SQRT2f128 __f128 (1.414213562373095048801688724209698079) /* sqrt(2) */
831 # define M_SQRT1_2f128 __f128 (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
832 #endif
834 #if __HAVE_FLOAT32X && defined __USE_GNU
835 # define M_Ef32x __f32x (2.718281828459045235360287471352662498) /* e */
836 # define M_LOG2Ef32x __f32x (1.442695040888963407359924681001892137) /* log_2 e */
837 # define M_LOG10Ef32x __f32x (0.434294481903251827651128918916605082) /* log_10 e */
838 # define M_LN2f32x __f32x (0.693147180559945309417232121458176568) /* log_e 2 */
839 # define M_LN10f32x __f32x (2.302585092994045684017991454684364208) /* log_e 10 */
840 # define M_PIf32x __f32x (3.141592653589793238462643383279502884) /* pi */
841 # define M_PI_2f32x __f32x (1.570796326794896619231321691639751442) /* pi/2 */
842 # define M_PI_4f32x __f32x (0.785398163397448309615660845819875721) /* pi/4 */
843 # define M_1_PIf32x __f32x (0.318309886183790671537767526745028724) /* 1/pi */
844 # define M_2_PIf32x __f32x (0.636619772367581343075535053490057448) /* 2/pi */
845 # define M_2_SQRTPIf32x __f32x (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
846 # define M_SQRT2f32x __f32x (1.414213562373095048801688724209698079) /* sqrt(2) */
847 # define M_SQRT1_2f32x __f32x (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
848 #endif
850 #if __HAVE_FLOAT64X && defined __USE_GNU
851 # define M_Ef64x __f64x (2.718281828459045235360287471352662498) /* e */
852 # define M_LOG2Ef64x __f64x (1.442695040888963407359924681001892137) /* log_2 e */
853 # define M_LOG10Ef64x __f64x (0.434294481903251827651128918916605082) /* log_10 e */
854 # define M_LN2f64x __f64x (0.693147180559945309417232121458176568) /* log_e 2 */
855 # define M_LN10f64x __f64x (2.302585092994045684017991454684364208) /* log_e 10 */
856 # define M_PIf64x __f64x (3.141592653589793238462643383279502884) /* pi */
857 # define M_PI_2f64x __f64x (1.570796326794896619231321691639751442) /* pi/2 */
858 # define M_PI_4f64x __f64x (0.785398163397448309615660845819875721) /* pi/4 */
859 # define M_1_PIf64x __f64x (0.318309886183790671537767526745028724) /* 1/pi */
860 # define M_2_PIf64x __f64x (0.636619772367581343075535053490057448) /* 2/pi */
861 # define M_2_SQRTPIf64x __f64x (1.128379167095512573896158903121545172) /* 2/sqrt(pi) */
862 # define M_SQRT2f64x __f64x (1.414213562373095048801688724209698079) /* sqrt(2) */
863 # define M_SQRT1_2f64x __f64x (0.707106781186547524400844362104849039) /* 1/sqrt(2) */
864 #endif
866 #if __HAVE_FLOAT128X && defined __USE_GNU
867 # error "M_* values needed for _Float128x"
868 #endif
870 /* When compiling in strict ISO C compatible mode we must not use the
871 inline functions since they, among other things, do not set the
872 `errno' variable correctly. */
873 #if defined __STRICT_ANSI__ && !defined __NO_MATH_INLINES
874 # define __NO_MATH_INLINES 1
875 #endif
877 #ifdef __USE_ISOC99
878 # if __GNUC_PREREQ (3, 1)
879 /* ISO C99 defines some macros to compare number while taking care for
880 unordered numbers. Many FPUs provide special instructions to support
881 these operations. Generic support in GCC for these as builtins went
882 in 2.97, but not all cpus added their patterns until 3.1. Therefore
883 we enable the builtins from 3.1 onwards and use a generic implementation
884 othwerwise. */
885 # define isgreater(x, y) __builtin_isgreater(x, y)
886 # define isgreaterequal(x, y) __builtin_isgreaterequal(x, y)
887 # define isless(x, y) __builtin_isless(x, y)
888 # define islessequal(x, y) __builtin_islessequal(x, y)
889 # define islessgreater(x, y) __builtin_islessgreater(x, y)
890 # define isunordered(x, y) __builtin_isunordered(x, y)
891 # else
892 # define isgreater(x, y) \
893 (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \
894 !isunordered (__x, __y) && __x > __y; }))
895 # define isgreaterequal(x, y) \
896 (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \
897 !isunordered (__x, __y) && __x >= __y; }))
898 # define isless(x, y) \
899 (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \
900 !isunordered (__x, __y) && __x < __y; }))
901 # define islessequal(x, y) \
902 (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \
903 !isunordered (__x, __y) && __x <= __y; }))
904 # define islessgreater(x, y) \
905 (__extension__ ({ __typeof__ (x) __x = (x); __typeof__ (y) __y = (y); \
906 !isunordered (__x, __y) && __x != __y; }))
907 /* isunordered must always check both operands first for signaling NaNs. */
908 # define isunordered(x, y) \
909 (__extension__ ({ __typeof__ (x) __u = (x); __typeof__ (y) __v = (y); \
910 __u != __v && (__u != __u || __v != __v); }))
911 # endif
912 #endif
914 /* Get machine-dependent inline versions (if there are any). */
915 #ifdef __USE_EXTERN_INLINES
916 # include <bits/mathinline.h>
917 #endif
919 /* Define special entry points to use when the compiler got told to
920 only expect finite results. */
921 #if defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0
923 /* Include bits/math-finite.h for double. */
924 # define _Mdouble_ double
925 # define __MATH_DECLARING_DOUBLE 1
926 # define __MATH_DECLARING_FLOATN 0
927 # define __REDIRFROM_X(function, reentrant) \
928 function ## reentrant
929 # define __REDIRTO_X(function, reentrant) \
930 __ ## function ## reentrant ## _finite
931 # include <bits/math-finite.h>
932 # undef _Mdouble_
933 # undef __MATH_DECLARING_DOUBLE
934 # undef __MATH_DECLARING_FLOATN
935 # undef __REDIRFROM_X
936 # undef __REDIRTO_X
938 /* When __USE_ISOC99 is defined, include math-finite for float and
939 long double, as well. */
940 # ifdef __USE_ISOC99
942 /* Include bits/math-finite.h for float. */
943 # define _Mdouble_ float
944 # define __MATH_DECLARING_DOUBLE 0
945 # define __MATH_DECLARING_FLOATN 0
946 # define __REDIRFROM_X(function, reentrant) \
947 function ## f ## reentrant
948 # define __REDIRTO_X(function, reentrant) \
949 __ ## function ## f ## reentrant ## _finite
950 # include <bits/math-finite.h>
951 # undef _Mdouble_
952 # undef __MATH_DECLARING_DOUBLE
953 # undef __MATH_DECLARING_FLOATN
954 # undef __REDIRFROM_X
955 # undef __REDIRTO_X
957 /* Include bits/math-finite.h for long double. */
958 # ifdef __MATH_DECLARE_LDOUBLE
959 # define _Mdouble_ long double
960 # define __MATH_DECLARING_DOUBLE 0
961 # define __MATH_DECLARING_FLOATN 0
962 # define __REDIRFROM_X(function, reentrant) \
963 function ## l ## reentrant
964 # ifdef __NO_LONG_DOUBLE_MATH
965 # define __REDIRTO_X(function, reentrant) \
966 __ ## function ## reentrant ## _finite
967 # else
968 # define __REDIRTO_X(function, reentrant) \
969 __ ## function ## l ## reentrant ## _finite
970 # endif
971 # include <bits/math-finite.h>
972 # undef _Mdouble_
973 # undef __MATH_DECLARING_DOUBLE
974 # undef __MATH_DECLARING_FLOATN
975 # undef __REDIRFROM_X
976 # undef __REDIRTO_X
977 # endif
979 # endif /* __USE_ISOC99. */
981 /* Include bits/math-finite.h for float128. */
982 # if (__HAVE_DISTINCT_FLOAT128 || (__HAVE_FLOAT128 && !defined _LIBC)) \
983 && __GLIBC_USE (IEC_60559_TYPES_EXT)
984 # define _Mdouble_ _Float128
985 # define __MATH_DECLARING_DOUBLE 0
986 # define __MATH_DECLARING_FLOATN 1
987 # define __REDIRFROM_X(function, reentrant) \
988 function ## f128 ## reentrant
989 # if __HAVE_DISTINCT_FLOAT128
990 # define __REDIRTO_X(function, reentrant) \
991 __ ## function ## f128 ## reentrant ## _finite
992 # else
993 # define __REDIRTO_X(function, reentrant) \
994 __ ## function ## l ## reentrant ## _finite
995 # endif
996 # include <bits/math-finite.h>
997 # undef _Mdouble_
998 # undef __MATH_DECLARING_DOUBLE
999 # undef __MATH_DECLARING_FLOATN
1000 # undef __REDIRFROM_X
1001 # undef __REDIRTO_X
1002 # endif
1003 #endif /* __FINITE_MATH_ONLY__ > 0. */
1005 #if __GLIBC_USE (IEC_60559_BFP_EXT)
1006 /* An expression whose type has the widest of the evaluation formats
1007 of X and Y (which are of floating-point types). */
1008 # if __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ > 64
1009 # define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0L)
1010 # elif __FLT_EVAL_METHOD__ == 1 || __FLT_EVAL_METHOD__ > 32
1011 # define __MATH_EVAL_FMT2(x, y) ((x) + (y) + 0.0)
1012 # else
1013 # define __MATH_EVAL_FMT2(x, y) ((x) + (y))
1014 # endif
1016 /* Return X == Y but raising "invalid" and setting errno if X or Y is
1017 a NaN. */
1018 # define iseqsig(x, y) \
1019 __MATH_TG (__MATH_EVAL_FMT2 (x, y), __iseqsig, ((x), (y)))
1020 #endif
1022 __END_DECLS
1025 #endif /* math.h */