1 /* A GNU-like <math.h>.
3 Copyright (C) 2002-2003, 2007-2019 Free Software Foundation, Inc.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program 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
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 #ifndef _@GUARD_PREFIX@_MATH_H
21 @PRAGMA_SYSTEM_HEADER@
25 /* The include_next requires a split double-inclusion guard. */
26 #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
28 #ifndef _@GUARD_PREFIX@_MATH_H
29 #define _@GUARD_PREFIX@_MATH_H
31 /* On OpenVMS, NAN, INFINITY, and HUGEVAL macros are defined in <fp.h>. */
32 #if defined __VMS && ! defined NAN
36 #ifndef _GL_INLINE_HEADER_BEGIN
37 #error "Please include config.h first."
39 _GL_INLINE_HEADER_BEGIN
40 #ifndef _GL_MATH_INLINE
41 # define _GL_MATH_INLINE _GL_INLINE
44 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
46 /* The definition of _GL_ARG_NONNULL is copied here. */
48 /* The definition of _GL_WARN_ON_USE is copied here. */
51 /* Helper macros to define type-generic function FUNC as overloaded functions,
52 rather than as macros like in C. POSIX declares these with an argument of
53 real-floating (that is, one of float, double, or long double). */
54 # define _GL_MATH_CXX_REAL_FLOATING_DECL_1(func) \
56 _gl_cxx_ ## func ## f (float f) \
61 _gl_cxx_ ## func ## d (double d) \
66 _gl_cxx_ ## func ## l (long double l) \
70 # define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \
75 return _gl_cxx_ ## func ## f (f); \
80 return _gl_cxx_ ## func ## d (d); \
83 func (long double l) \
85 return _gl_cxx_ ## func ## l (l); \
90 /* Helper macros to define a portability warning for the
91 classification macro FUNC called with VALUE. POSIX declares the
92 classification macros with an argument of real-floating (that is,
93 one of float, double, or long double). */
94 #define _GL_WARN_REAL_FLOATING_DECL(func) \
96 _GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - " \
97 "use gnulib module " #func " for portability") \
98 rpl_ ## func ## f (float f) \
102 _GL_MATH_INLINE int \
103 _GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - " \
104 "use gnulib module " #func " for portability") \
105 rpl_ ## func ## d (double d) \
109 _GL_MATH_INLINE int \
110 _GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - " \
111 "use gnulib module " #func " for portability") \
112 rpl_ ## func ## l (long double l) \
116 #define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
117 (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value) \
118 : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value) \
119 : rpl_ ## func ## l (value))
123 /* Pull in a function that fixes the 'int' to 'long double' conversion
125 _GL_EXTERN_C
void _Qp_itoq (long double *, int);
126 static void (*_gl_math_fix_itold
) (long double *, int) = _Qp_itoq
;
130 /* POSIX allows platforms that don't support NAN. But all major
131 machines in the past 15 years have supported something close to
132 IEEE NaN, so we define this unconditionally. We also must define
133 it on platforms like Solaris 10, where NAN is present but defined
134 as a function pointer rather than a floating point constant. */
135 #if !defined NAN || @REPLACE_NAN@
136 # if !GNULIB_defined_NAN
138 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler
139 choke on the expression 0.0 / 0.0. */
140 # if defined __DECC || defined _MSC_VER
141 _GL_MATH_INLINE
float
144 static float zero
= 0.0f
;
147 # define NAN (_NaN())
149 # define NAN (0.0f / 0.0f)
151 # define GNULIB_defined_NAN 1
155 /* Solaris 10 defines HUGE_VAL, but as a function pointer rather
156 than a floating point constant. */
157 #if @REPLACE_HUGE_VAL@
159 # define HUGE_VALF (1.0f / 0.0f)
161 # define HUGE_VAL (1.0 / 0.0)
163 # define HUGE_VALL (1.0L / 0.0L)
166 /* HUGE_VALF is a 'float' Infinity. */
168 # if defined _MSC_VER
169 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f. */
170 # define HUGE_VALF (1e25f * 1e25f)
172 # define HUGE_VALF (1.0f / 0.0f)
176 /* HUGE_VAL is a 'double' Infinity. */
178 # if defined _MSC_VER
179 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0. */
180 # define HUGE_VAL (1e250 * 1e250)
182 # define HUGE_VAL (1.0 / 0.0)
186 /* HUGE_VALL is a 'long double' Infinity. */
188 # if defined _MSC_VER
189 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L. */
190 # define HUGE_VALL (1e250L * 1e250L)
192 # define HUGE_VALL (1.0L / 0.0L)
197 #if defined FP_ILOGB0 && defined FP_ILOGBNAN
198 /* Ensure FP_ILOGB0 and FP_ILOGBNAN are correct. */
199 # if defined __HAIKU__
200 /* Haiku: match what ilogb() does */
203 # define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
204 # define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
207 /* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined. */
208 # if defined __NetBSD__ || defined __sgi
209 /* NetBSD, IRIX 6.5: match what ilogb() does */
210 # define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
211 # define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
213 /* AIX 5.1: match what ilogb() does in AIX >= 5.2 */
214 # define FP_ILOGB0 (- 2147483647 - 1) /* INT_MIN */
215 # define FP_ILOGBNAN 2147483647 /* INT_MAX */
217 /* Solaris 9: match what ilogb() does */
218 # define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
219 # define FP_ILOGBNAN 2147483647 /* INT_MAX */
221 /* Gnulib defined values. */
222 # define FP_ILOGB0 (- 2147483647) /* - INT_MAX */
223 # define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
230 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
232 # define acosf rpl_acosf
234 _GL_FUNCDECL_RPL (acosf
, float, (float x
));
235 _GL_CXXALIAS_RPL (acosf
, float, (float x
));
239 _GL_FUNCDECL_SYS (acosf
, float, (float x
));
241 _GL_CXXALIAS_SYS (acosf
, float, (float x
));
243 _GL_CXXALIASWARN (acosf
);
244 #elif defined GNULIB_POSIXCHECK
246 # if HAVE_RAW_DECL_ACOSF
247 _GL_WARN_ON_USE (acosf
, "acosf is unportable - "
248 "use gnulib module acosf for portability");
253 # if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
255 _GL_FUNCDECL_SYS (acosl
, long double, (long double x
));
257 _GL_CXXALIAS_SYS (acosl
, long double, (long double x
));
258 _GL_CXXALIASWARN (acosl
);
259 #elif defined GNULIB_POSIXCHECK
261 # if HAVE_RAW_DECL_ACOSL
262 _GL_WARN_ON_USE (acosl
, "acosl is unportable - "
263 "use gnulib module acosl for portability");
270 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
272 # define asinf rpl_asinf
274 _GL_FUNCDECL_RPL (asinf
, float, (float x
));
275 _GL_CXXALIAS_RPL (asinf
, float, (float x
));
279 _GL_FUNCDECL_SYS (asinf
, float, (float x
));
281 _GL_CXXALIAS_SYS (asinf
, float, (float x
));
283 _GL_CXXALIASWARN (asinf
);
284 #elif defined GNULIB_POSIXCHECK
286 # if HAVE_RAW_DECL_ASINF
287 _GL_WARN_ON_USE (asinf
, "asinf is unportable - "
288 "use gnulib module asinf for portability");
293 # if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
295 _GL_FUNCDECL_SYS (asinl
, long double, (long double x
));
297 _GL_CXXALIAS_SYS (asinl
, long double, (long double x
));
298 _GL_CXXALIASWARN (asinl
);
299 #elif defined GNULIB_POSIXCHECK
301 # if HAVE_RAW_DECL_ASINL
302 _GL_WARN_ON_USE (asinl
, "asinl is unportable - "
303 "use gnulib module asinl for portability");
310 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
312 # define atanf rpl_atanf
314 _GL_FUNCDECL_RPL (atanf
, float, (float x
));
315 _GL_CXXALIAS_RPL (atanf
, float, (float x
));
319 _GL_FUNCDECL_SYS (atanf
, float, (float x
));
321 _GL_CXXALIAS_SYS (atanf
, float, (float x
));
323 _GL_CXXALIASWARN (atanf
);
324 #elif defined GNULIB_POSIXCHECK
326 # if HAVE_RAW_DECL_ATANF
327 _GL_WARN_ON_USE (atanf
, "atanf is unportable - "
328 "use gnulib module atanf for portability");
333 # if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
335 _GL_FUNCDECL_SYS (atanl
, long double, (long double x
));
337 _GL_CXXALIAS_SYS (atanl
, long double, (long double x
));
338 _GL_CXXALIASWARN (atanl
);
339 #elif defined GNULIB_POSIXCHECK
341 # if HAVE_RAW_DECL_ATANL
342 _GL_WARN_ON_USE (atanl
, "atanl is unportable - "
343 "use gnulib module atanl for portability");
349 # if @REPLACE_ATAN2F@
350 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
352 # define atan2f rpl_atan2f
354 _GL_FUNCDECL_RPL (atan2f
, float, (float y
, float x
));
355 _GL_CXXALIAS_RPL (atan2f
, float, (float y
, float x
));
359 _GL_FUNCDECL_SYS (atan2f
, float, (float y
, float x
));
361 _GL_CXXALIAS_SYS (atan2f
, float, (float y
, float x
));
363 _GL_CXXALIASWARN (atan2f
);
364 #elif defined GNULIB_POSIXCHECK
366 # if HAVE_RAW_DECL_ATAN2F
367 _GL_WARN_ON_USE (atan2f
, "atan2f is unportable - "
368 "use gnulib module atan2f for portability");
375 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
377 # define cbrtf rpl_cbrtf
379 _GL_FUNCDECL_RPL (cbrtf
, float, (float x
));
380 _GL_CXXALIAS_RPL (cbrtf
, float, (float x
));
382 # if !@HAVE_DECL_CBRTF@
383 _GL_FUNCDECL_SYS (cbrtf
, float, (float x
));
385 _GL_CXXALIAS_SYS (cbrtf
, float, (float x
));
387 _GL_CXXALIASWARN (cbrtf
);
388 #elif defined GNULIB_POSIXCHECK
390 # if HAVE_RAW_DECL_CBRTF
391 _GL_WARN_ON_USE (cbrtf
, "cbrtf is unportable - "
392 "use gnulib module cbrtf for portability");
398 _GL_FUNCDECL_SYS (cbrt
, double, (double x
));
400 _GL_CXXALIAS_SYS (cbrt
, double, (double x
));
401 _GL_CXXALIASWARN (cbrt
);
402 #elif defined GNULIB_POSIXCHECK
404 # if HAVE_RAW_DECL_CBRT
405 _GL_WARN_ON_USE (cbrt
, "cbrt is unportable - "
406 "use gnulib module cbrt for portability");
412 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
414 # define cbrtl rpl_cbrtl
416 _GL_FUNCDECL_RPL (cbrtl
, long double, (long double x
));
417 _GL_CXXALIAS_RPL (cbrtl
, long double, (long double x
));
419 # if !@HAVE_DECL_CBRTL@
420 _GL_FUNCDECL_SYS (cbrtl
, long double, (long double x
));
422 _GL_CXXALIAS_SYS (cbrtl
, long double, (long double x
));
424 _GL_CXXALIASWARN (cbrtl
);
425 #elif defined GNULIB_POSIXCHECK
427 # if HAVE_RAW_DECL_CBRTL
428 _GL_WARN_ON_USE (cbrtl
, "cbrtl is unportable - "
429 "use gnulib module cbrtl for portability");
436 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
438 # define ceilf rpl_ceilf
440 _GL_FUNCDECL_RPL (ceilf
, float, (float x
));
441 _GL_CXXALIAS_RPL (ceilf
, float, (float x
));
443 # if !@HAVE_DECL_CEILF@
445 _GL_FUNCDECL_SYS (ceilf
, float, (float x
));
447 _GL_CXXALIAS_SYS (ceilf
, float, (float x
));
449 _GL_CXXALIASWARN (ceilf
);
450 #elif defined GNULIB_POSIXCHECK
452 # if HAVE_RAW_DECL_CEILF
453 _GL_WARN_ON_USE (ceilf
, "ceilf is unportable - "
454 "use gnulib module ceilf for portability");
460 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
462 # define ceil rpl_ceil
464 _GL_FUNCDECL_RPL (ceil
, double, (double x
));
465 _GL_CXXALIAS_RPL (ceil
, double, (double x
));
467 _GL_CXXALIAS_SYS (ceil
, double, (double x
));
469 _GL_CXXALIASWARN (ceil
);
474 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
476 # define ceill rpl_ceill
478 _GL_FUNCDECL_RPL (ceill
, long double, (long double x
));
479 _GL_CXXALIAS_RPL (ceill
, long double, (long double x
));
481 # if !@HAVE_DECL_CEILL@
483 _GL_FUNCDECL_SYS (ceill
, long double, (long double x
));
485 _GL_CXXALIAS_SYS (ceill
, long double, (long double x
));
487 _GL_CXXALIASWARN (ceill
);
488 #elif defined GNULIB_POSIXCHECK
490 # if HAVE_RAW_DECL_CEILL
491 _GL_WARN_ON_USE (ceill
, "ceill is unportable - "
492 "use gnulib module ceill for portability");
497 #if @GNULIB_COPYSIGNF@
498 # if !@HAVE_DECL_COPYSIGNF@
499 _GL_FUNCDECL_SYS (copysignf
, float, (float x
, float y
));
501 _GL_CXXALIAS_SYS (copysignf
, float, (float x
, float y
));
502 _GL_CXXALIASWARN (copysignf
);
503 #elif defined GNULIB_POSIXCHECK
505 # if HAVE_RAW_DECL_COPYSIGNF
506 _GL_WARN_ON_USE (copysignf
, "copysignf is unportable - "
507 "use gnulib module copysignf for portability");
511 #if @GNULIB_COPYSIGN@
512 # if !@HAVE_COPYSIGN@
513 _GL_FUNCDECL_SYS (copysign
, double, (double x
, double y
));
515 _GL_CXXALIAS_SYS (copysign
, double, (double x
, double y
));
516 _GL_CXXALIASWARN (copysign
);
517 #elif defined GNULIB_POSIXCHECK
519 # if HAVE_RAW_DECL_COPYSIGN
520 _GL_WARN_ON_USE (copysign
, "copysign is unportable - "
521 "use gnulib module copysign for portability");
525 #if @GNULIB_COPYSIGNL@
526 # if !@HAVE_COPYSIGNL@
527 _GL_FUNCDECL_SYS (copysignl
, long double, (long double x
, long double y
));
529 _GL_CXXALIAS_SYS (copysignl
, long double, (long double x
, long double y
));
530 _GL_CXXALIASWARN (copysignl
);
531 #elif defined GNULIB_POSIXCHECK
533 # if HAVE_RAW_DECL_COPYSIGNL
534 _GL_WARN_ON_USE (copysign
, "copysignl is unportable - "
535 "use gnulib module copysignl for portability");
542 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
544 # define cosf rpl_cosf
546 _GL_FUNCDECL_RPL (cosf
, float, (float x
));
547 _GL_CXXALIAS_RPL (cosf
, float, (float x
));
551 _GL_FUNCDECL_SYS (cosf
, float, (float x
));
553 _GL_CXXALIAS_SYS (cosf
, float, (float x
));
555 _GL_CXXALIASWARN (cosf
);
556 #elif defined GNULIB_POSIXCHECK
558 # if HAVE_RAW_DECL_COSF
559 _GL_WARN_ON_USE (cosf
, "cosf is unportable - "
560 "use gnulib module cosf for portability");
565 # if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
567 _GL_FUNCDECL_SYS (cosl
, long double, (long double x
));
569 _GL_CXXALIAS_SYS (cosl
, long double, (long double x
));
570 _GL_CXXALIASWARN (cosl
);
571 #elif defined GNULIB_POSIXCHECK
573 # if HAVE_RAW_DECL_COSL
574 _GL_WARN_ON_USE (cosl
, "cosl is unportable - "
575 "use gnulib module cosl for portability");
582 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
584 # define coshf rpl_coshf
586 _GL_FUNCDECL_RPL (coshf
, float, (float x
));
587 _GL_CXXALIAS_RPL (coshf
, float, (float x
));
591 _GL_FUNCDECL_SYS (coshf
, float, (float x
));
593 _GL_CXXALIAS_SYS (coshf
, float, (float x
));
595 _GL_CXXALIASWARN (coshf
);
596 #elif defined GNULIB_POSIXCHECK
598 # if HAVE_RAW_DECL_COSHF
599 _GL_WARN_ON_USE (coshf
, "coshf is unportable - "
600 "use gnulib module coshf for portability");
607 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
609 # define expf rpl_expf
611 _GL_FUNCDECL_RPL (expf
, float, (float x
));
612 _GL_CXXALIAS_RPL (expf
, float, (float x
));
616 _GL_FUNCDECL_SYS (expf
, float, (float x
));
618 _GL_CXXALIAS_SYS (expf
, float, (float x
));
620 _GL_CXXALIASWARN (expf
);
621 #elif defined GNULIB_POSIXCHECK
623 # if HAVE_RAW_DECL_EXPF
624 _GL_WARN_ON_USE (expf
, "expf is unportable - "
625 "use gnulib module expf for portability");
630 # if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
632 _GL_FUNCDECL_SYS (expl
, long double, (long double x
));
634 _GL_CXXALIAS_SYS (expl
, long double, (long double x
));
635 _GL_CXXALIASWARN (expl
);
636 #elif defined GNULIB_POSIXCHECK
638 # if HAVE_RAW_DECL_EXPL
639 _GL_WARN_ON_USE (expl
, "expl is unportable - "
640 "use gnulib module expl for portability");
646 # if !@HAVE_DECL_EXP2F@
647 _GL_FUNCDECL_SYS (exp2f
, float, (float x
));
649 _GL_CXXALIAS_SYS (exp2f
, float, (float x
));
650 _GL_CXXALIASWARN (exp2f
);
651 #elif defined GNULIB_POSIXCHECK
653 # if HAVE_RAW_DECL_EXP2F
654 _GL_WARN_ON_USE (exp2f
, "exp2f is unportable - "
655 "use gnulib module exp2f for portability");
661 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
663 # define exp2 rpl_exp2
665 _GL_FUNCDECL_RPL (exp2
, double, (double x
));
666 _GL_CXXALIAS_RPL (exp2
, double, (double x
));
668 # if !@HAVE_DECL_EXP2@
669 _GL_FUNCDECL_SYS (exp2
, double, (double x
));
671 _GL_CXXALIAS_SYS (exp2
, double, (double x
));
673 _GL_CXXALIASWARN (exp2
);
674 #elif defined GNULIB_POSIXCHECK
676 # if HAVE_RAW_DECL_EXP2
677 _GL_WARN_ON_USE (exp2
, "exp2 is unportable - "
678 "use gnulib module exp2 for portability");
684 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
686 # define exp2l rpl_exp2l
688 _GL_FUNCDECL_RPL (exp2l
, long double, (long double x
));
689 _GL_CXXALIAS_RPL (exp2l
, long double, (long double x
));
691 # if !@HAVE_DECL_EXP2L@
693 _GL_FUNCDECL_SYS (exp2l
, long double, (long double x
));
695 _GL_CXXALIAS_SYS (exp2l
, long double, (long double x
));
697 _GL_CXXALIASWARN (exp2l
);
698 #elif defined GNULIB_POSIXCHECK
700 # if HAVE_RAW_DECL_EXP2L
701 _GL_WARN_ON_USE (exp2l
, "exp2l is unportable - "
702 "use gnulib module exp2l for portability");
708 # if @REPLACE_EXPM1F@
709 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
711 # define expm1f rpl_expm1f
713 _GL_FUNCDECL_RPL (expm1f
, float, (float x
));
714 _GL_CXXALIAS_RPL (expm1f
, float, (float x
));
717 _GL_FUNCDECL_SYS (expm1f
, float, (float x
));
719 _GL_CXXALIAS_SYS (expm1f
, float, (float x
));
721 _GL_CXXALIASWARN (expm1f
);
722 #elif defined GNULIB_POSIXCHECK
724 # if HAVE_RAW_DECL_EXPM1F
725 _GL_WARN_ON_USE (expm1f
, "expm1f is unportable - "
726 "use gnulib module expm1f for portability");
732 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
734 # define expm1 rpl_expm1
736 _GL_FUNCDECL_RPL (expm1
, double, (double x
));
737 _GL_CXXALIAS_RPL (expm1
, double, (double x
));
740 _GL_FUNCDECL_SYS (expm1
, double, (double x
));
742 _GL_CXXALIAS_SYS (expm1
, double, (double x
));
744 _GL_CXXALIASWARN (expm1
);
745 #elif defined GNULIB_POSIXCHECK
747 # if HAVE_RAW_DECL_EXPM1
748 _GL_WARN_ON_USE (expm1
, "expm1 is unportable - "
749 "use gnulib module expm1 for portability");
754 # if !@HAVE_DECL_EXPM1L@
756 _GL_FUNCDECL_SYS (expm1l
, long double, (long double x
));
758 _GL_CXXALIAS_SYS (expm1l
, long double, (long double x
));
759 _GL_CXXALIASWARN (expm1l
);
760 #elif defined GNULIB_POSIXCHECK
762 # if HAVE_RAW_DECL_EXPM1L
763 _GL_WARN_ON_USE (expm1l
, "expm1l is unportable - "
764 "use gnulib module expm1l for portability");
772 _GL_FUNCDECL_SYS (fabsf
, float, (float x
));
774 _GL_CXXALIAS_SYS (fabsf
, float, (float x
));
775 _GL_CXXALIASWARN (fabsf
);
776 #elif defined GNULIB_POSIXCHECK
778 # if HAVE_RAW_DECL_FABSF
779 _GL_WARN_ON_USE (fabsf
, "fabsf is unportable - "
780 "use gnulib module fabsf for portability");
786 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
788 # define fabsl rpl_fabsl
790 _GL_FUNCDECL_RPL (fabsl
, long double, (long double x
));
791 _GL_CXXALIAS_RPL (fabsl
, long double, (long double x
));
795 _GL_FUNCDECL_SYS (fabsl
, long double, (long double x
));
797 _GL_CXXALIAS_SYS (fabsl
, long double, (long double x
));
799 _GL_CXXALIASWARN (fabsl
);
800 #elif defined GNULIB_POSIXCHECK
802 # if HAVE_RAW_DECL_FABSL
803 _GL_WARN_ON_USE (fabsl
, "fabsl is unportable - "
804 "use gnulib module fabsl for portability");
810 # if @REPLACE_FLOORF@
811 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
813 # define floorf rpl_floorf
815 _GL_FUNCDECL_RPL (floorf
, float, (float x
));
816 _GL_CXXALIAS_RPL (floorf
, float, (float x
));
818 # if !@HAVE_DECL_FLOORF@
820 _GL_FUNCDECL_SYS (floorf
, float, (float x
));
822 _GL_CXXALIAS_SYS (floorf
, float, (float x
));
824 _GL_CXXALIASWARN (floorf
);
825 #elif defined GNULIB_POSIXCHECK
827 # if HAVE_RAW_DECL_FLOORF
828 _GL_WARN_ON_USE (floorf
, "floorf is unportable - "
829 "use gnulib module floorf for portability");
835 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
837 # define floor rpl_floor
839 _GL_FUNCDECL_RPL (floor
, double, (double x
));
840 _GL_CXXALIAS_RPL (floor
, double, (double x
));
842 _GL_CXXALIAS_SYS (floor
, double, (double x
));
844 _GL_CXXALIASWARN (floor
);
848 # if @REPLACE_FLOORL@
849 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
851 # define floorl rpl_floorl
853 _GL_FUNCDECL_RPL (floorl
, long double, (long double x
));
854 _GL_CXXALIAS_RPL (floorl
, long double, (long double x
));
856 # if !@HAVE_DECL_FLOORL@
858 _GL_FUNCDECL_SYS (floorl
, long double, (long double x
));
860 _GL_CXXALIAS_SYS (floorl
, long double, (long double x
));
862 _GL_CXXALIASWARN (floorl
);
863 #elif defined GNULIB_POSIXCHECK
865 # if HAVE_RAW_DECL_FLOORL
866 _GL_WARN_ON_USE (floorl
, "floorl is unportable - "
867 "use gnulib module floorl for portability");
874 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
876 # define fmaf rpl_fmaf
878 _GL_FUNCDECL_RPL (fmaf
, float, (float x
, float y
, float z
));
879 _GL_CXXALIAS_RPL (fmaf
, float, (float x
, float y
, float z
));
882 _GL_FUNCDECL_SYS (fmaf
, float, (float x
, float y
, float z
));
884 _GL_CXXALIAS_SYS (fmaf
, float, (float x
, float y
, float z
));
886 _GL_CXXALIASWARN (fmaf
);
887 #elif defined GNULIB_POSIXCHECK
889 # if HAVE_RAW_DECL_FMAF
890 _GL_WARN_ON_USE (fmaf
, "fmaf is unportable - "
891 "use gnulib module fmaf for portability");
897 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
901 _GL_FUNCDECL_RPL (fma
, double, (double x
, double y
, double z
));
902 _GL_CXXALIAS_RPL (fma
, double, (double x
, double y
, double z
));
905 _GL_FUNCDECL_SYS (fma
, double, (double x
, double y
, double z
));
907 _GL_CXXALIAS_SYS (fma
, double, (double x
, double y
, double z
));
909 _GL_CXXALIASWARN (fma
);
910 #elif defined GNULIB_POSIXCHECK
912 # if HAVE_RAW_DECL_FMA
913 _GL_WARN_ON_USE (fma
, "fma is unportable - "
914 "use gnulib module fma for portability");
920 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
922 # define fmal rpl_fmal
924 _GL_FUNCDECL_RPL (fmal
, long double,
925 (long double x
, long double y
, long double z
));
926 _GL_CXXALIAS_RPL (fmal
, long double,
927 (long double x
, long double y
, long double z
));
931 _GL_FUNCDECL_SYS (fmal
, long double,
932 (long double x
, long double y
, long double z
));
934 _GL_CXXALIAS_SYS (fmal
, long double,
935 (long double x
, long double y
, long double z
));
937 _GL_CXXALIASWARN (fmal
);
938 #elif defined GNULIB_POSIXCHECK
940 # if HAVE_RAW_DECL_FMAL
941 _GL_WARN_ON_USE (fmal
, "fmal is unportable - "
942 "use gnulib module fmal for portability");
949 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
951 # define fmodf rpl_fmodf
953 _GL_FUNCDECL_RPL (fmodf
, float, (float x
, float y
));
954 _GL_CXXALIAS_RPL (fmodf
, float, (float x
, float y
));
958 _GL_FUNCDECL_SYS (fmodf
, float, (float x
, float y
));
960 _GL_CXXALIAS_SYS (fmodf
, float, (float x
, float y
));
962 _GL_CXXALIASWARN (fmodf
);
963 #elif defined GNULIB_POSIXCHECK
965 # if HAVE_RAW_DECL_FMODF
966 _GL_WARN_ON_USE (fmodf
, "fmodf is unportable - "
967 "use gnulib module fmodf for portability");
973 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
975 # define fmod rpl_fmod
977 _GL_FUNCDECL_RPL (fmod
, double, (double x
, double y
));
978 _GL_CXXALIAS_RPL (fmod
, double, (double x
, double y
));
980 _GL_CXXALIAS_SYS (fmod
, double, (double x
, double y
));
982 _GL_CXXALIASWARN (fmod
);
983 #elif defined GNULIB_POSIXCHECK
985 # if HAVE_RAW_DECL_FMOD
986 _GL_WARN_ON_USE (fmod
, "fmod has portability problems - "
987 "use gnulib module fmod for portability");
993 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
995 # define fmodl rpl_fmodl
997 _GL_FUNCDECL_RPL (fmodl
, long double, (long double x
, long double y
));
998 _GL_CXXALIAS_RPL (fmodl
, long double, (long double x
, long double y
));
1002 _GL_FUNCDECL_SYS (fmodl
, long double, (long double x
, long double y
));
1004 _GL_CXXALIAS_SYS (fmodl
, long double, (long double x
, long double y
));
1006 _GL_CXXALIASWARN (fmodl
);
1007 #elif defined GNULIB_POSIXCHECK
1009 # if HAVE_RAW_DECL_FMODL
1010 _GL_WARN_ON_USE (fmodl
, "fmodl is unportable - "
1011 "use gnulib module fmodl for portability");
1017 x = mantissa * 2^exp
1019 If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
1020 If x is zero: mantissa = x, exp = 0.
1021 If x is infinite or NaN: mantissa = x, exp unspecified.
1022 Store exp in *EXPPTR and return mantissa. */
1024 # if @REPLACE_FREXPF@
1025 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1027 # define frexpf rpl_frexpf
1029 _GL_FUNCDECL_RPL (frexpf
, float, (float x
, int *expptr
) _GL_ARG_NONNULL ((2)));
1030 _GL_CXXALIAS_RPL (frexpf
, float, (float x
, int *expptr
));
1034 _GL_FUNCDECL_SYS (frexpf
, float, (float x
, int *expptr
) _GL_ARG_NONNULL ((2)));
1036 _GL_CXXALIAS_SYS (frexpf
, float, (float x
, int *expptr
));
1038 _GL_CXXALIASWARN (frexpf
);
1039 #elif defined GNULIB_POSIXCHECK
1041 # if HAVE_RAW_DECL_FREXPF
1042 _GL_WARN_ON_USE (frexpf
, "frexpf is unportable - "
1043 "use gnulib module frexpf for portability");
1048 x = mantissa * 2^exp
1050 If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
1051 If x is zero: mantissa = x, exp = 0.
1052 If x is infinite or NaN: mantissa = x, exp unspecified.
1053 Store exp in *EXPPTR and return mantissa. */
1055 # if @REPLACE_FREXP@
1056 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1058 # define frexp rpl_frexp
1060 _GL_FUNCDECL_RPL (frexp
, double, (double x
, int *expptr
) _GL_ARG_NONNULL ((2)));
1061 _GL_CXXALIAS_RPL (frexp
, double, (double x
, int *expptr
));
1063 _GL_CXXALIAS_SYS (frexp
, double, (double x
, int *expptr
));
1065 _GL_CXXALIASWARN1 (frexp
, double, (double x
, int *expptr
));
1066 #elif defined GNULIB_POSIXCHECK
1068 /* Assume frexp is always declared. */
1069 _GL_WARN_ON_USE (frexp
, "frexp is unportable - "
1070 "use gnulib module frexp for portability");
1074 x = mantissa * 2^exp
1076 If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
1077 If x is zero: mantissa = x, exp = 0.
1078 If x is infinite or NaN: mantissa = x, exp unspecified.
1079 Store exp in *EXPPTR and return mantissa. */
1080 #if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
1081 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1083 # define frexpl rpl_frexpl
1085 _GL_FUNCDECL_RPL (frexpl
, long double,
1086 (long double x
, int *expptr
) _GL_ARG_NONNULL ((2)));
1087 _GL_CXXALIAS_RPL (frexpl
, long double, (long double x
, int *expptr
));
1089 # if !@HAVE_DECL_FREXPL@
1090 _GL_FUNCDECL_SYS (frexpl
, long double,
1091 (long double x
, int *expptr
) _GL_ARG_NONNULL ((2)));
1093 # if @GNULIB_FREXPL@
1094 _GL_CXXALIAS_SYS (frexpl
, long double, (long double x
, int *expptr
));
1097 #if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
1098 _GL_CXXALIASWARN (frexpl
);
1100 #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
1102 # if HAVE_RAW_DECL_FREXPL
1103 _GL_WARN_ON_USE (frexpl
, "frexpl is unportable - "
1104 "use gnulib module frexpl for portability");
1109 /* Return sqrt(x^2+y^2). */
1111 # if @REPLACE_HYPOTF@
1112 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1114 # define hypotf rpl_hypotf
1116 _GL_FUNCDECL_RPL (hypotf
, float, (float x
, float y
));
1117 _GL_CXXALIAS_RPL (hypotf
, float, (float x
, float y
));
1120 _GL_FUNCDECL_SYS (hypotf
, float, (float x
, float y
));
1122 _GL_CXXALIAS_SYS (hypotf
, float, (float x
, float y
));
1124 _GL_CXXALIASWARN (hypotf
);
1125 #elif defined GNULIB_POSIXCHECK
1127 # if HAVE_RAW_DECL_HYPOTF
1128 _GL_WARN_ON_USE (hypotf
, "hypotf is unportable - "
1129 "use gnulib module hypotf for portability");
1133 /* Return sqrt(x^2+y^2). */
1135 # if @REPLACE_HYPOT@
1136 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1138 # define hypot rpl_hypot
1140 _GL_FUNCDECL_RPL (hypot
, double, (double x
, double y
));
1141 _GL_CXXALIAS_RPL (hypot
, double, (double x
, double y
));
1143 _GL_CXXALIAS_SYS (hypot
, double, (double x
, double y
));
1145 _GL_CXXALIASWARN (hypot
);
1146 #elif defined GNULIB_POSIXCHECK
1148 # if HAVE_RAW_DECL_HYPOT
1149 _GL_WARN_ON_USE (hypotf
, "hypot has portability problems - "
1150 "use gnulib module hypot for portability");
1154 /* Return sqrt(x^2+y^2). */
1156 # if @REPLACE_HYPOTL@
1157 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1159 # define hypotl rpl_hypotl
1161 _GL_FUNCDECL_RPL (hypotl
, long double, (long double x
, long double y
));
1162 _GL_CXXALIAS_RPL (hypotl
, long double, (long double x
, long double y
));
1165 _GL_FUNCDECL_SYS (hypotl
, long double, (long double x
, long double y
));
1167 _GL_CXXALIAS_SYS (hypotl
, long double, (long double x
, long double y
));
1169 _GL_CXXALIASWARN (hypotl
);
1170 #elif defined GNULIB_POSIXCHECK
1172 # if HAVE_RAW_DECL_HYPOTL
1173 _GL_WARN_ON_USE (hypotl
, "hypotl is unportable - "
1174 "use gnulib module hypotl for portability");
1180 # if @REPLACE_ILOGBF@
1181 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1183 # define ilogbf rpl_ilogbf
1185 _GL_FUNCDECL_RPL (ilogbf
, int, (float x
));
1186 _GL_CXXALIAS_RPL (ilogbf
, int, (float x
));
1189 _GL_FUNCDECL_SYS (ilogbf
, int, (float x
));
1191 _GL_CXXALIAS_SYS (ilogbf
, int, (float x
));
1193 _GL_CXXALIASWARN (ilogbf
);
1194 #elif defined GNULIB_POSIXCHECK
1196 # if HAVE_RAW_DECL_ILOGBF
1197 _GL_WARN_ON_USE (ilogbf
, "ilogbf is unportable - "
1198 "use gnulib module ilogbf for portability");
1203 # if @REPLACE_ILOGB@
1204 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1206 # define ilogb rpl_ilogb
1208 _GL_FUNCDECL_RPL (ilogb
, int, (double x
));
1209 _GL_CXXALIAS_RPL (ilogb
, int, (double x
));
1212 _GL_FUNCDECL_SYS (ilogb
, int, (double x
));
1214 _GL_CXXALIAS_SYS (ilogb
, int, (double x
));
1216 _GL_CXXALIASWARN (ilogb
);
1217 #elif defined GNULIB_POSIXCHECK
1219 # if HAVE_RAW_DECL_ILOGB
1220 _GL_WARN_ON_USE (ilogb
, "ilogb is unportable - "
1221 "use gnulib module ilogb for portability");
1226 # if @REPLACE_ILOGBL@
1227 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1229 # define ilogbl rpl_ilogbl
1231 _GL_FUNCDECL_RPL (ilogbl
, int, (long double x
));
1232 _GL_CXXALIAS_RPL (ilogbl
, int, (long double x
));
1235 _GL_FUNCDECL_SYS (ilogbl
, int, (long double x
));
1237 _GL_CXXALIAS_SYS (ilogbl
, int, (long double x
));
1239 _GL_CXXALIASWARN (ilogbl
);
1240 #elif defined GNULIB_POSIXCHECK
1242 # if HAVE_RAW_DECL_ILOGBL
1243 _GL_WARN_ON_USE (ilogbl
, "ilogbl is unportable - "
1244 "use gnulib module ilogbl for portability");
1249 /* Return x * 2^exp. */
1253 _GL_FUNCDECL_SYS (ldexpf
, float, (float x
, int exp
));
1255 _GL_CXXALIAS_SYS (ldexpf
, float, (float x
, int exp
));
1256 _GL_CXXALIASWARN (ldexpf
);
1257 #elif defined GNULIB_POSIXCHECK
1259 # if HAVE_RAW_DECL_LDEXPF
1260 _GL_WARN_ON_USE (ldexpf
, "ldexpf is unportable - "
1261 "use gnulib module ldexpf for portability");
1265 /* Return x * 2^exp. */
1266 #if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
1267 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1269 # define ldexpl rpl_ldexpl
1271 _GL_FUNCDECL_RPL (ldexpl
, long double, (long double x
, int exp
));
1272 _GL_CXXALIAS_RPL (ldexpl
, long double, (long double x
, int exp
));
1274 # if !@HAVE_DECL_LDEXPL@
1275 _GL_FUNCDECL_SYS (ldexpl
, long double, (long double x
, int exp
));
1277 # if @GNULIB_LDEXPL@
1278 _GL_CXXALIAS_SYS (ldexpl
, long double, (long double x
, int exp
));
1282 _GL_CXXALIASWARN (ldexpl
);
1284 #if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
1286 # if HAVE_RAW_DECL_LDEXPL
1287 _GL_WARN_ON_USE (ldexpl
, "ldexpl is unportable - "
1288 "use gnulib module ldexpl for portability");
1295 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1297 # define logf rpl_logf
1299 _GL_FUNCDECL_RPL (logf
, float, (float x
));
1300 _GL_CXXALIAS_RPL (logf
, float, (float x
));
1304 _GL_FUNCDECL_SYS (logf
, float, (float x
));
1306 _GL_CXXALIAS_SYS (logf
, float, (float x
));
1308 _GL_CXXALIASWARN (logf
);
1309 #elif defined GNULIB_POSIXCHECK
1311 # if HAVE_RAW_DECL_LOGF
1312 _GL_WARN_ON_USE (logf
, "logf is unportable - "
1313 "use gnulib module logf for portability");
1319 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1321 # define log rpl_log
1323 _GL_FUNCDECL_RPL (log
, double, (double x
));
1324 _GL_CXXALIAS_RPL (log
, double, (double x
));
1326 _GL_CXXALIAS_SYS (log
, double, (double x
));
1328 _GL_CXXALIASWARN (log
);
1329 #elif defined GNULIB_POSIXCHECK
1331 # if HAVE_RAW_DECL_LOG
1332 _GL_WARN_ON_USE (log
, "log has portability problems - "
1333 "use gnulib module log for portability");
1339 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1341 # define logl rpl_logl
1343 _GL_FUNCDECL_RPL (logl
, long double, (long double x
));
1344 _GL_CXXALIAS_RPL (logl
, long double, (long double x
));
1346 # if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
1348 _GL_FUNCDECL_SYS (logl
, long double, (long double x
));
1350 _GL_CXXALIAS_SYS (logl
, long double, (long double x
));
1352 _GL_CXXALIASWARN (logl
);
1353 #elif defined GNULIB_POSIXCHECK
1355 # if HAVE_RAW_DECL_LOGL
1356 _GL_WARN_ON_USE (logl
, "logl is unportable - "
1357 "use gnulib module logl for portability");
1363 # if @REPLACE_LOG10F@
1364 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1366 # define log10f rpl_log10f
1368 _GL_FUNCDECL_RPL (log10f
, float, (float x
));
1369 _GL_CXXALIAS_RPL (log10f
, float, (float x
));
1373 _GL_FUNCDECL_SYS (log10f
, float, (float x
));
1375 _GL_CXXALIAS_SYS (log10f
, float, (float x
));
1377 _GL_CXXALIASWARN (log10f
);
1378 #elif defined GNULIB_POSIXCHECK
1380 # if HAVE_RAW_DECL_LOG10F
1381 _GL_WARN_ON_USE (log10f
, "log10f is unportable - "
1382 "use gnulib module log10f for portability");
1387 # if @REPLACE_LOG10@
1388 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1390 # define log10 rpl_log10
1392 _GL_FUNCDECL_RPL (log10
, double, (double x
));
1393 _GL_CXXALIAS_RPL (log10
, double, (double x
));
1395 _GL_CXXALIAS_SYS (log10
, double, (double x
));
1397 _GL_CXXALIASWARN (log10
);
1398 #elif defined GNULIB_POSIXCHECK
1400 # if HAVE_RAW_DECL_LOG10
1401 _GL_WARN_ON_USE (log10
, "log10 has portability problems - "
1402 "use gnulib module log10 for portability");
1407 # if @REPLACE_LOG10L@
1408 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1410 # define log10l rpl_log10l
1412 _GL_FUNCDECL_RPL (log10l
, long double, (long double x
));
1413 _GL_CXXALIAS_RPL (log10l
, long double, (long double x
));
1415 # if !@HAVE_LOG10L@ || !@HAVE_DECL_LOG10L@
1417 _GL_FUNCDECL_SYS (log10l
, long double, (long double x
));
1419 _GL_CXXALIAS_SYS (log10l
, long double, (long double x
));
1421 _GL_CXXALIASWARN (log10l
);
1422 #elif defined GNULIB_POSIXCHECK
1424 # if HAVE_RAW_DECL_LOG10L
1425 _GL_WARN_ON_USE (log10l
, "log10l is unportable - "
1426 "use gnulib module log10l for portability");
1432 # if @REPLACE_LOG1PF@
1433 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1435 # define log1pf rpl_log1pf
1437 _GL_FUNCDECL_RPL (log1pf
, float, (float x
));
1438 _GL_CXXALIAS_RPL (log1pf
, float, (float x
));
1441 _GL_FUNCDECL_SYS (log1pf
, float, (float x
));
1443 _GL_CXXALIAS_SYS (log1pf
, float, (float x
));
1445 _GL_CXXALIASWARN (log1pf
);
1446 #elif defined GNULIB_POSIXCHECK
1448 # if HAVE_RAW_DECL_LOG1PF
1449 _GL_WARN_ON_USE (log1pf
, "log1pf is unportable - "
1450 "use gnulib module log1pf for portability");
1455 # if @REPLACE_LOG1P@
1456 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1458 # define log1p rpl_log1p
1460 _GL_FUNCDECL_RPL (log1p
, double, (double x
));
1461 _GL_CXXALIAS_RPL (log1p
, double, (double x
));
1464 _GL_FUNCDECL_SYS (log1p
, double, (double x
));
1466 _GL_CXXALIAS_SYS (log1p
, double, (double x
));
1468 _GL_CXXALIASWARN (log1p
);
1469 #elif defined GNULIB_POSIXCHECK
1471 # if HAVE_RAW_DECL_LOG1P
1472 _GL_WARN_ON_USE (log1p
, "log1p has portability problems - "
1473 "use gnulib module log1p for portability");
1478 # if @REPLACE_LOG1PL@
1479 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1481 # define log1pl rpl_log1pl
1483 _GL_FUNCDECL_RPL (log1pl
, long double, (long double x
));
1484 _GL_CXXALIAS_RPL (log1pl
, long double, (long double x
));
1487 _GL_FUNCDECL_SYS (log1pl
, long double, (long double x
));
1489 _GL_CXXALIAS_SYS (log1pl
, long double, (long double x
));
1491 _GL_CXXALIASWARN (log1pl
);
1492 #elif defined GNULIB_POSIXCHECK
1494 # if HAVE_RAW_DECL_LOG1PL
1495 _GL_WARN_ON_USE (log1pl
, "log1pl has portability problems - "
1496 "use gnulib module log1pl for portability");
1502 # if @REPLACE_LOG2F@
1503 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1505 # define log2f rpl_log2f
1507 _GL_FUNCDECL_RPL (log2f
, float, (float x
));
1508 _GL_CXXALIAS_RPL (log2f
, float, (float x
));
1510 # if !@HAVE_DECL_LOG2F@
1512 _GL_FUNCDECL_SYS (log2f
, float, (float x
));
1514 _GL_CXXALIAS_SYS (log2f
, float, (float x
));
1516 _GL_CXXALIASWARN (log2f
);
1517 #elif defined GNULIB_POSIXCHECK
1519 # if HAVE_RAW_DECL_LOG2F
1520 _GL_WARN_ON_USE (log2f
, "log2f is unportable - "
1521 "use gnulib module log2f for portability");
1527 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1529 # define log2 rpl_log2
1531 _GL_FUNCDECL_RPL (log2
, double, (double x
));
1532 _GL_CXXALIAS_RPL (log2
, double, (double x
));
1534 # if !@HAVE_DECL_LOG2@
1536 _GL_FUNCDECL_SYS (log2
, double, (double x
));
1538 _GL_CXXALIAS_SYS (log2
, double, (double x
));
1540 _GL_CXXALIASWARN (log2
);
1541 #elif defined GNULIB_POSIXCHECK
1543 # if HAVE_RAW_DECL_LOG2
1544 _GL_WARN_ON_USE (log2
, "log2 is unportable - "
1545 "use gnulib module log2 for portability");
1550 # if @REPLACE_LOG2L@
1551 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1553 # define log2l rpl_log2l
1555 _GL_FUNCDECL_RPL (log2l
, long double, (long double x
));
1556 _GL_CXXALIAS_RPL (log2l
, long double, (long double x
));
1558 # if !@HAVE_DECL_LOG2L@
1559 _GL_FUNCDECL_SYS (log2l
, long double, (long double x
));
1561 _GL_CXXALIAS_SYS (log2l
, long double, (long double x
));
1563 _GL_CXXALIASWARN (log2l
);
1564 #elif defined GNULIB_POSIXCHECK
1566 # if HAVE_RAW_DECL_LOG2L
1567 _GL_WARN_ON_USE (log2l
, "log2l is unportable - "
1568 "use gnulib module log2l for portability");
1574 # if @REPLACE_LOGBF@
1575 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1577 # define logbf rpl_logbf
1579 _GL_FUNCDECL_RPL (logbf
, float, (float x
));
1580 _GL_CXXALIAS_RPL (logbf
, float, (float x
));
1583 _GL_FUNCDECL_SYS (logbf
, float, (float x
));
1585 _GL_CXXALIAS_SYS (logbf
, float, (float x
));
1587 _GL_CXXALIASWARN (logbf
);
1588 #elif defined GNULIB_POSIXCHECK
1590 # if HAVE_RAW_DECL_LOGBF
1591 _GL_WARN_ON_USE (logbf
, "logbf is unportable - "
1592 "use gnulib module logbf for portability");
1598 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1600 # define logb rpl_logb
1602 _GL_FUNCDECL_RPL (logb
, double, (double x
));
1603 _GL_CXXALIAS_RPL (logb
, double, (double x
));
1605 # if !@HAVE_DECL_LOGB@
1606 _GL_FUNCDECL_SYS (logb
, double, (double x
));
1608 _GL_CXXALIAS_SYS (logb
, double, (double x
));
1610 _GL_CXXALIASWARN (logb
);
1611 #elif defined GNULIB_POSIXCHECK
1613 # if HAVE_RAW_DECL_LOGB
1614 _GL_WARN_ON_USE (logb
, "logb is unportable - "
1615 "use gnulib module logb for portability");
1620 # if @REPLACE_LOGBL@
1621 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1623 # define logbl rpl_logbl
1625 _GL_FUNCDECL_RPL (logbl
, long double, (long double x
));
1626 _GL_CXXALIAS_RPL (logbl
, long double, (long double x
));
1629 _GL_FUNCDECL_SYS (logbl
, long double, (long double x
));
1631 _GL_CXXALIAS_SYS (logbl
, long double, (long double x
));
1633 _GL_CXXALIASWARN (logbl
);
1634 #elif defined GNULIB_POSIXCHECK
1636 # if HAVE_RAW_DECL_LOGBL
1637 _GL_WARN_ON_USE (logbl
, "logbl is unportable - "
1638 "use gnulib module logbl for portability");
1644 # if @REPLACE_MODFF@
1645 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1647 # define modff rpl_modff
1649 _GL_FUNCDECL_RPL (modff
, float, (float x
, float *iptr
) _GL_ARG_NONNULL ((2)));
1650 _GL_CXXALIAS_RPL (modff
, float, (float x
, float *iptr
));
1654 _GL_FUNCDECL_SYS (modff
, float, (float x
, float *iptr
) _GL_ARG_NONNULL ((2)));
1656 _GL_CXXALIAS_SYS (modff
, float, (float x
, float *iptr
));
1658 _GL_CXXALIASWARN (modff
);
1659 #elif defined GNULIB_POSIXCHECK
1661 # if HAVE_RAW_DECL_MODFF
1662 _GL_WARN_ON_USE (modff
, "modff is unportable - "
1663 "use gnulib module modff for portability");
1669 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1671 # define modf rpl_modf
1673 _GL_FUNCDECL_RPL (modf
, double, (double x
, double *iptr
) _GL_ARG_NONNULL ((2)));
1674 _GL_CXXALIAS_RPL (modf
, double, (double x
, double *iptr
));
1676 _GL_CXXALIAS_SYS (modf
, double, (double x
, double *iptr
));
1678 _GL_CXXALIASWARN (modf
);
1679 #elif defined GNULIB_POSIXCHECK
1681 # if HAVE_RAW_DECL_MODF
1682 _GL_WARN_ON_USE (modf
, "modf has portability problems - "
1683 "use gnulib module modf for portability");
1688 # if @REPLACE_MODFL@
1689 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1691 # define modfl rpl_modfl
1693 _GL_FUNCDECL_RPL (modfl
, long double, (long double x
, long double *iptr
)
1694 _GL_ARG_NONNULL ((2)));
1695 _GL_CXXALIAS_RPL (modfl
, long double, (long double x
, long double *iptr
));
1699 _GL_FUNCDECL_SYS (modfl
, long double, (long double x
, long double *iptr
)
1700 _GL_ARG_NONNULL ((2)));
1702 _GL_CXXALIAS_SYS (modfl
, long double, (long double x
, long double *iptr
));
1704 _GL_CXXALIASWARN (modfl
);
1705 #elif defined GNULIB_POSIXCHECK
1707 # if HAVE_RAW_DECL_MODFL
1708 _GL_WARN_ON_USE (modfl
, "modfl is unportable - "
1709 "use gnulib module modfl for portability");
1717 _GL_FUNCDECL_SYS (powf
, float, (float x
, float y
));
1719 _GL_CXXALIAS_SYS (powf
, float, (float x
, float y
));
1720 _GL_CXXALIASWARN (powf
);
1721 #elif defined GNULIB_POSIXCHECK
1723 # if HAVE_RAW_DECL_POWF
1724 _GL_WARN_ON_USE (powf
, "powf is unportable - "
1725 "use gnulib module powf for portability");
1730 #if @GNULIB_REMAINDERF@
1731 # if @REPLACE_REMAINDERF@
1732 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1734 # define remainderf rpl_remainderf
1736 _GL_FUNCDECL_RPL (remainderf
, float, (float x
, float y
));
1737 _GL_CXXALIAS_RPL (remainderf
, float, (float x
, float y
));
1739 # if !@HAVE_REMAINDERF@
1740 _GL_FUNCDECL_SYS (remainderf
, float, (float x
, float y
));
1742 _GL_CXXALIAS_SYS (remainderf
, float, (float x
, float y
));
1744 _GL_CXXALIASWARN (remainderf
);
1745 #elif defined GNULIB_POSIXCHECK
1747 # if HAVE_RAW_DECL_REMAINDERF
1748 _GL_WARN_ON_USE (remainderf
, "remainderf is unportable - "
1749 "use gnulib module remainderf for portability");
1753 #if @GNULIB_REMAINDER@
1754 # if @REPLACE_REMAINDER@
1755 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1757 # define remainder rpl_remainder
1759 _GL_FUNCDECL_RPL (remainder
, double, (double x
, double y
));
1760 _GL_CXXALIAS_RPL (remainder
, double, (double x
, double y
));
1762 # if !@HAVE_REMAINDER@ || !@HAVE_DECL_REMAINDER@
1763 _GL_FUNCDECL_SYS (remainder
, double, (double x
, double y
));
1765 _GL_CXXALIAS_SYS (remainder
, double, (double x
, double y
));
1767 _GL_CXXALIASWARN (remainder
);
1768 #elif defined GNULIB_POSIXCHECK
1770 # if HAVE_RAW_DECL_REMAINDER
1771 _GL_WARN_ON_USE (remainder
, "remainder is unportable - "
1772 "use gnulib module remainder for portability");
1776 #if @GNULIB_REMAINDERL@
1777 # if @REPLACE_REMAINDERL@
1778 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1780 # define remainderl rpl_remainderl
1782 _GL_FUNCDECL_RPL (remainderl
, long double, (long double x
, long double y
));
1783 _GL_CXXALIAS_RPL (remainderl
, long double, (long double x
, long double y
));
1785 # if !@HAVE_DECL_REMAINDERL@
1787 _GL_FUNCDECL_SYS (remainderl
, long double, (long double x
, long double y
));
1789 _GL_CXXALIAS_SYS (remainderl
, long double, (long double x
, long double y
));
1791 _GL_CXXALIASWARN (remainderl
);
1792 #elif defined GNULIB_POSIXCHECK
1794 # if HAVE_RAW_DECL_REMAINDERL
1795 _GL_WARN_ON_USE (remainderl
, "remainderl is unportable - "
1796 "use gnulib module remainderl for portability");
1802 # if !@HAVE_DECL_RINTF@
1803 _GL_FUNCDECL_SYS (rintf
, float, (float x
));
1805 _GL_CXXALIAS_SYS (rintf
, float, (float x
));
1806 _GL_CXXALIASWARN (rintf
);
1807 #elif defined GNULIB_POSIXCHECK
1809 # if HAVE_RAW_DECL_RINTF
1810 _GL_WARN_ON_USE (rintf
, "rintf is unportable - "
1811 "use gnulib module rintf for portability");
1817 _GL_FUNCDECL_SYS (rint
, double, (double x
));
1819 _GL_CXXALIAS_SYS (rint
, double, (double x
));
1820 _GL_CXXALIASWARN (rint
);
1821 #elif defined GNULIB_POSIXCHECK
1823 # if HAVE_RAW_DECL_RINT
1824 _GL_WARN_ON_USE (rint
, "rint is unportable - "
1825 "use gnulib module rint for portability");
1831 _GL_FUNCDECL_SYS (rintl
, long double, (long double x
));
1833 _GL_CXXALIAS_SYS (rintl
, long double, (long double x
));
1834 _GL_CXXALIASWARN (rintl
);
1835 #elif defined GNULIB_POSIXCHECK
1837 # if HAVE_RAW_DECL_RINTL
1838 _GL_WARN_ON_USE (rintl
, "rintl is unportable - "
1839 "use gnulib module rintl for portability");
1845 # if @REPLACE_ROUNDF@
1846 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1848 # define roundf rpl_roundf
1850 _GL_FUNCDECL_RPL (roundf
, float, (float x
));
1851 _GL_CXXALIAS_RPL (roundf
, float, (float x
));
1853 # if !@HAVE_DECL_ROUNDF@
1854 _GL_FUNCDECL_SYS (roundf
, float, (float x
));
1856 _GL_CXXALIAS_SYS (roundf
, float, (float x
));
1858 _GL_CXXALIASWARN (roundf
);
1859 #elif defined GNULIB_POSIXCHECK
1861 # if HAVE_RAW_DECL_ROUNDF
1862 _GL_WARN_ON_USE (roundf
, "roundf is unportable - "
1863 "use gnulib module roundf for portability");
1868 # if @REPLACE_ROUND@
1869 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1871 # define round rpl_round
1873 _GL_FUNCDECL_RPL (round
, double, (double x
));
1874 _GL_CXXALIAS_RPL (round
, double, (double x
));
1876 # if !@HAVE_DECL_ROUND@
1877 _GL_FUNCDECL_SYS (round
, double, (double x
));
1879 _GL_CXXALIAS_SYS (round
, double, (double x
));
1881 _GL_CXXALIASWARN (round
);
1882 #elif defined GNULIB_POSIXCHECK
1884 # if HAVE_RAW_DECL_ROUND
1885 _GL_WARN_ON_USE (round
, "round is unportable - "
1886 "use gnulib module round for portability");
1891 # if @REPLACE_ROUNDL@
1892 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1894 # define roundl rpl_roundl
1896 _GL_FUNCDECL_RPL (roundl
, long double, (long double x
));
1897 _GL_CXXALIAS_RPL (roundl
, long double, (long double x
));
1899 # if !@HAVE_DECL_ROUNDL@
1901 _GL_FUNCDECL_SYS (roundl
, long double, (long double x
));
1903 _GL_CXXALIAS_SYS (roundl
, long double, (long double x
));
1905 _GL_CXXALIASWARN (roundl
);
1906 #elif defined GNULIB_POSIXCHECK
1908 # if HAVE_RAW_DECL_ROUNDL
1909 _GL_WARN_ON_USE (roundl
, "roundl is unportable - "
1910 "use gnulib module roundl for portability");
1917 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1919 # define sinf rpl_sinf
1921 _GL_FUNCDECL_RPL (sinf
, float, (float x
));
1922 _GL_CXXALIAS_RPL (sinf
, float, (float x
));
1926 _GL_FUNCDECL_SYS (sinf
, float, (float x
));
1928 _GL_CXXALIAS_SYS (sinf
, float, (float x
));
1930 _GL_CXXALIASWARN (sinf
);
1931 #elif defined GNULIB_POSIXCHECK
1933 # if HAVE_RAW_DECL_SINF
1934 _GL_WARN_ON_USE (sinf
, "sinf is unportable - "
1935 "use gnulib module sinf for portability");
1940 # if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
1942 _GL_FUNCDECL_SYS (sinl
, long double, (long double x
));
1944 _GL_CXXALIAS_SYS (sinl
, long double, (long double x
));
1945 _GL_CXXALIASWARN (sinl
);
1946 #elif defined GNULIB_POSIXCHECK
1948 # if HAVE_RAW_DECL_SINL
1949 _GL_WARN_ON_USE (sinl
, "sinl is unportable - "
1950 "use gnulib module sinl for portability");
1956 # if @REPLACE_SINHF@
1957 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1959 # define sinhf rpl_sinhf
1961 _GL_FUNCDECL_RPL (sinhf
, float, (float x
));
1962 _GL_CXXALIAS_RPL (sinhf
, float, (float x
));
1966 _GL_FUNCDECL_SYS (sinhf
, float, (float x
));
1968 _GL_CXXALIAS_SYS (sinhf
, float, (float x
));
1970 _GL_CXXALIASWARN (sinhf
);
1971 #elif defined GNULIB_POSIXCHECK
1973 # if HAVE_RAW_DECL_SINHF
1974 _GL_WARN_ON_USE (sinhf
, "sinhf is unportable - "
1975 "use gnulib module sinhf for portability");
1981 # if @REPLACE_SQRTF@
1982 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1984 # define sqrtf rpl_sqrtf
1986 _GL_FUNCDECL_RPL (sqrtf
, float, (float x
));
1987 _GL_CXXALIAS_RPL (sqrtf
, float, (float x
));
1991 _GL_FUNCDECL_SYS (sqrtf
, float, (float x
));
1993 _GL_CXXALIAS_SYS (sqrtf
, float, (float x
));
1995 _GL_CXXALIASWARN (sqrtf
);
1996 #elif defined GNULIB_POSIXCHECK
1998 # if HAVE_RAW_DECL_SQRTF
1999 _GL_WARN_ON_USE (sqrtf
, "sqrtf is unportable - "
2000 "use gnulib module sqrtf for portability");
2005 # if @REPLACE_SQRTL@
2006 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2008 # define sqrtl rpl_sqrtl
2010 _GL_FUNCDECL_RPL (sqrtl
, long double, (long double x
));
2011 _GL_CXXALIAS_RPL (sqrtl
, long double, (long double x
));
2013 # if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
2015 _GL_FUNCDECL_SYS (sqrtl
, long double, (long double x
));
2017 _GL_CXXALIAS_SYS (sqrtl
, long double, (long double x
));
2019 _GL_CXXALIASWARN (sqrtl
);
2020 #elif defined GNULIB_POSIXCHECK
2022 # if HAVE_RAW_DECL_SQRTL
2023 _GL_WARN_ON_USE (sqrtl
, "sqrtl is unportable - "
2024 "use gnulib module sqrtl for portability");
2031 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2033 # define tanf rpl_tanf
2035 _GL_FUNCDECL_RPL (tanf
, float, (float x
));
2036 _GL_CXXALIAS_RPL (tanf
, float, (float x
));
2040 _GL_FUNCDECL_SYS (tanf
, float, (float x
));
2042 _GL_CXXALIAS_SYS (tanf
, float, (float x
));
2044 _GL_CXXALIASWARN (tanf
);
2045 #elif defined GNULIB_POSIXCHECK
2047 # if HAVE_RAW_DECL_TANF
2048 _GL_WARN_ON_USE (tanf
, "tanf is unportable - "
2049 "use gnulib module tanf for portability");
2054 # if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
2056 _GL_FUNCDECL_SYS (tanl
, long double, (long double x
));
2058 _GL_CXXALIAS_SYS (tanl
, long double, (long double x
));
2059 _GL_CXXALIASWARN (tanl
);
2060 #elif defined GNULIB_POSIXCHECK
2062 # if HAVE_RAW_DECL_TANL
2063 _GL_WARN_ON_USE (tanl
, "tanl is unportable - "
2064 "use gnulib module tanl for portability");
2070 # if @REPLACE_TANHF@
2071 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2073 # define tanhf rpl_tanhf
2075 _GL_FUNCDECL_RPL (tanhf
, float, (float x
));
2076 _GL_CXXALIAS_RPL (tanhf
, float, (float x
));
2080 _GL_FUNCDECL_SYS (tanhf
, float, (float x
));
2082 _GL_CXXALIAS_SYS (tanhf
, float, (float x
));
2084 _GL_CXXALIASWARN (tanhf
);
2085 #elif defined GNULIB_POSIXCHECK
2087 # if HAVE_RAW_DECL_TANHF
2088 _GL_WARN_ON_USE (tanhf
, "tanhf is unportable - "
2089 "use gnulib module tanhf for portability");
2095 # if @REPLACE_TRUNCF@
2096 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2098 # define truncf rpl_truncf
2100 _GL_FUNCDECL_RPL (truncf
, float, (float x
));
2101 _GL_CXXALIAS_RPL (truncf
, float, (float x
));
2103 # if !@HAVE_DECL_TRUNCF@
2104 _GL_FUNCDECL_SYS (truncf
, float, (float x
));
2106 _GL_CXXALIAS_SYS (truncf
, float, (float x
));
2108 _GL_CXXALIASWARN (truncf
);
2109 #elif defined GNULIB_POSIXCHECK
2111 # if HAVE_RAW_DECL_TRUNCF
2112 _GL_WARN_ON_USE (truncf
, "truncf is unportable - "
2113 "use gnulib module truncf for portability");
2118 # if @REPLACE_TRUNC@
2119 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2121 # define trunc rpl_trunc
2123 _GL_FUNCDECL_RPL (trunc
, double, (double x
));
2124 _GL_CXXALIAS_RPL (trunc
, double, (double x
));
2126 # if !@HAVE_DECL_TRUNC@
2127 _GL_FUNCDECL_SYS (trunc
, double, (double x
));
2129 _GL_CXXALIAS_SYS (trunc
, double, (double x
));
2131 _GL_CXXALIASWARN (trunc
);
2132 #elif defined GNULIB_POSIXCHECK
2134 # if HAVE_RAW_DECL_TRUNC
2135 _GL_WARN_ON_USE (trunc
, "trunc is unportable - "
2136 "use gnulib module trunc for portability");
2141 # if @REPLACE_TRUNCL@
2142 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
2144 # define truncl rpl_truncl
2146 _GL_FUNCDECL_RPL (truncl
, long double, (long double x
));
2147 _GL_CXXALIAS_RPL (truncl
, long double, (long double x
));
2149 # if !@HAVE_DECL_TRUNCL@
2150 _GL_FUNCDECL_SYS (truncl
, long double, (long double x
));
2152 _GL_CXXALIAS_SYS (truncl
, long double, (long double x
));
2154 _GL_CXXALIASWARN (truncl
);
2155 #elif defined GNULIB_POSIXCHECK
2157 # if HAVE_RAW_DECL_TRUNCL
2158 _GL_WARN_ON_USE (truncl
, "truncl is unportable - "
2159 "use gnulib module truncl for portability");
2164 /* Definitions of function-like macros come here, after the function
2168 #if @GNULIB_ISFINITE@
2169 # if @REPLACE_ISFINITE@
2170 _GL_EXTERN_C
int gl_isfinitef (float x
);
2171 _GL_EXTERN_C
int gl_isfinited (double x
);
2172 _GL_EXTERN_C
int gl_isfinitel (long double x
);
2174 # define isfinite(x) \
2175 (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
2176 sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
2180 # if defined isfinite || defined GNULIB_NAMESPACE
2181 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite
)
2183 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite
)
2186 #elif defined GNULIB_POSIXCHECK
2187 # if defined isfinite
2188 _GL_WARN_REAL_FLOATING_DECL (isfinite
);
2190 # define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
2196 # if @REPLACE_ISINF@
2197 _GL_EXTERN_C
int gl_isinff (float x
);
2198 _GL_EXTERN_C
int gl_isinfd (double x
);
2199 _GL_EXTERN_C
int gl_isinfl (long double x
);
2202 (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
2203 sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
2207 # if defined isinf || defined GNULIB_NAMESPACE
2208 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf
)
2210 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf
)
2213 #elif defined GNULIB_POSIXCHECK
2215 _GL_WARN_REAL_FLOATING_DECL (isinf
);
2217 # define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
2223 /* Test for NaN for 'float' numbers. */
2225 /* The original <math.h> included above provides a declaration of isnan macro
2226 or (older) isnanf function. */
2228 /* GCC 4.0 and newer provides three built-ins for isnan. */
2230 # define isnanf(x) __builtin_isnanf ((float)(x))
2231 # elif defined isnan
2233 # define isnanf(x) isnan ((float)(x))
2236 /* Test whether X is a NaN. */
2238 # define isnanf rpl_isnanf
2239 _GL_EXTERN_C
int isnanf (float x
);
2244 /* Test for NaN for 'double' numbers.
2245 This function is a gnulib extension, unlike isnan() which applied only
2246 to 'double' numbers earlier but now is a type-generic macro. */
2248 /* The original <math.h> included above provides a declaration of isnan
2251 /* GCC 4.0 and newer provides three built-ins for isnan. */
2253 # define isnand(x) __builtin_isnan ((double)(x))
2256 # define isnand(x) isnan ((double)(x))
2259 /* Test whether X is a NaN. */
2261 # define isnand rpl_isnand
2262 _GL_EXTERN_C
int isnand (double x
);
2267 /* Test for NaN for 'long double' numbers. */
2269 /* The original <math.h> included above provides a declaration of isnan
2270 macro or (older) isnanl function. */
2272 /* GCC 4.0 and newer provides three built-ins for isnan. */
2274 # define isnanl(x) __builtin_isnanl ((long double)(x))
2275 # elif defined isnan
2277 # define isnanl(x) isnan ((long double)(x))
2280 /* Test whether X is a NaN. */
2282 # define isnanl rpl_isnanl
2283 _GL_EXTERN_C
int isnanl (long double x
) _GL_ATTRIBUTE_CONST
;
2287 /* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL! */
2289 # if @REPLACE_ISNAN@
2290 /* We can't just use the isnanf macro (e.g.) as exposed by
2291 isnanf.h (e.g.) here, because those may end up being macros
2292 that recursively expand back to isnan. So use the gnulib
2293 replacements for them directly. */
2294 # if @HAVE_ISNANF@ && __GNUC__ >= 4
2295 # define gl_isnan_f(x) __builtin_isnanf ((float)(x))
2297 _GL_EXTERN_C
int rpl_isnanf (float x
);
2298 # define gl_isnan_f(x) rpl_isnanf (x)
2300 # if @HAVE_ISNAND@ && __GNUC__ >= 4
2301 # define gl_isnan_d(x) __builtin_isnan ((double)(x))
2303 _GL_EXTERN_C
int rpl_isnand (double x
);
2304 # define gl_isnan_d(x) rpl_isnand (x)
2306 # if @HAVE_ISNANL@ && __GNUC__ >= 4
2307 # define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
2309 _GL_EXTERN_C
int rpl_isnanl (long double x
) _GL_ATTRIBUTE_CONST
;
2310 # define gl_isnan_l(x) rpl_isnanl (x)
2314 (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
2315 sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
2317 # elif __GNUC__ >= 4
2320 (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
2321 sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
2322 __builtin_isnanf ((float)(x)))
2325 # if defined isnan || defined GNULIB_NAMESPACE
2326 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan
)
2328 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan
)
2331 /* Ensure isnan is a macro. */
2333 # define isnan isnan
2336 #elif defined GNULIB_POSIXCHECK
2338 _GL_WARN_REAL_FLOATING_DECL (isnan
);
2340 # define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
2345 #if @GNULIB_SIGNBIT@
2346 # if (@REPLACE_SIGNBIT_USING_GCC@ \
2347 && (!defined __cplusplus || __cplusplus < 201103))
2349 /* GCC 4.0 and newer provides three built-ins for signbit. */
2350 # define signbit(x) \
2351 (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
2352 sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
2353 __builtin_signbitf (x))
2355 # if @REPLACE_SIGNBIT@
2357 _GL_EXTERN_C
int gl_signbitf (float arg
);
2358 _GL_EXTERN_C
int gl_signbitd (double arg
);
2359 _GL_EXTERN_C
int gl_signbitl (long double arg
);
2360 # if __GNUC__ >= 2 && !defined __STRICT_ANSI__
2361 # define _GL_NUM_UINT_WORDS(type) \
2362 ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
2363 # if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
2364 # define gl_signbitf_OPTIMIZED_MACRO
2365 # define gl_signbitf(arg) \
2366 ({ union { float _value; \
2367 unsigned int _word[_GL_NUM_UINT_WORDS (float)]; \
2369 _m._value = (arg); \
2370 (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1; \
2373 # if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
2374 # define gl_signbitd_OPTIMIZED_MACRO
2375 # define gl_signbitd(arg) \
2376 ({ union { double _value; \
2377 unsigned int _word[_GL_NUM_UINT_WORDS (double)]; \
2379 _m._value = (arg); \
2380 (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1; \
2383 # if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
2384 # define gl_signbitl_OPTIMIZED_MACRO
2385 # define gl_signbitl(arg) \
2386 ({ union { long double _value; \
2387 unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
2389 _m._value = (arg); \
2390 (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1; \
2394 # define signbit(x) \
2395 (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
2396 sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
2400 # if defined signbit || defined GNULIB_NAMESPACE
2401 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit
)
2403 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit
)
2406 #elif defined GNULIB_POSIXCHECK
2407 # if defined signbit
2408 _GL_WARN_REAL_FLOATING_DECL (signbit
);
2410 # define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
2414 _GL_INLINE_HEADER_END
2416 #endif /* _@GUARD_PREFIX@_MATH_H */
2417 #endif /* _@GUARD_PREFIX@_MATH_H */