New module 'copysignl'.
[gnulib.git] / lib / math.in.h
1 /* A GNU-like <math.h>.
2
3    Copyright (C) 2002-2003, 2007-2011 Free Software Foundation, Inc.
4
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.
9
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.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17
18 #ifndef _@GUARD_PREFIX@_MATH_H
19
20 #if __GNUC__ >= 3
21 @PRAGMA_SYSTEM_HEADER@
22 #endif
23 @PRAGMA_COLUMNS@
24
25 /* The include_next requires a split double-inclusion guard.  */
26 #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
27
28 #ifndef _@GUARD_PREFIX@_MATH_H
29 #define _@GUARD_PREFIX@_MATH_H
30
31
32 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
33
34 /* The definition of _GL_ARG_NONNULL is copied here.  */
35
36 /* The definition of _GL_WARN_ON_USE is copied here.  */
37
38 /* Helper macros to define a portability warning for the
39    classification macro FUNC called with VALUE.  POSIX declares the
40    classification macros with an argument of real-floating (that is,
41    one of float, double, or long double).  */
42 #define _GL_WARN_REAL_FLOATING_DECL(func) \
43 static inline int                                                   \
44 rpl_ ## func ## f (float f)                                         \
45 {                                                                   \
46   return func (f);                                                  \
47 }                                                                   \
48 static inline int                                                   \
49 rpl_ ## func ## d (double d)                                        \
50 {                                                                   \
51   return func (d);                                                  \
52 }                                                                   \
53 static inline int                                                   \
54 rpl_ ## func ## l (long double l)                                   \
55 {                                                                   \
56   return func (l);                                                  \
57 }                                                                   \
58 _GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - "       \
59                  "use gnulib module " #func " for portability");    \
60 _GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - "       \
61                  "use gnulib module " #func " for portability");    \
62 _GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - "       \
63                  "use gnulib module " #func " for portability")
64 #define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
65   (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value)     \
66    : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value)  \
67    : rpl_ ## func ## l (value))
68
69
70 #if @REPLACE_ITOLD@
71 /* Pull in a function that fixes the 'int' to 'long double' conversion
72    of glibc 2.7.  */
73 _GL_EXTERN_C void _Qp_itoq (long double *, int);
74 static void (*_gl_math_fix_itold) (long double *, int) = _Qp_itoq;
75 #endif
76
77
78 /* POSIX allows platforms that don't support NAN.  But all major
79    machines in the past 15 years have supported something close to
80    IEEE NaN, so we define this unconditionally.  We also must define
81    it on platforms like Solaris 10, where NAN is present but defined
82    as a function pointer rather than a floating point constant.  */
83 #if !defined NAN || @REPLACE_NAN@
84 # if !GNULIB_defined_NAN
85 #  undef NAN
86   /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler
87      choke on the expression 0.0 / 0.0.  */
88 #  if defined __DECC || defined _MSC_VER
89 static float
90 _NaN ()
91 {
92   static float zero = 0.0f;
93   return zero / zero;
94 }
95 #   define NAN (_NaN())
96 #  else
97 #   define NAN (0.0f / 0.0f)
98 #  endif
99 #  define GNULIB_defined_NAN 1
100 # endif
101 #endif
102
103 /* Solaris 10 defines HUGE_VAL, but as a function pointer rather
104    than a floating point constant.  */
105 #if @REPLACE_HUGE_VAL@
106 # undef HUGE_VAL
107 # define HUGE_VAL (1.0 / 0.0)
108 #endif
109
110
111 #if @GNULIB_ACOSF@
112 # if !@HAVE_ACOSF@
113 #  undef acosf
114 _GL_FUNCDECL_SYS (acosf, float, (float x));
115 # endif
116 _GL_CXXALIAS_SYS (acosf, float, (float x));
117 _GL_CXXALIASWARN (acosf);
118 #elif defined GNULIB_POSIXCHECK
119 # undef acosf
120 # if HAVE_RAW_DECL_ACOSF
121 _GL_WARN_ON_USE (acosf, "acosf is unportable - "
122                  "use gnulib module acosf for portability");
123 # endif
124 #endif
125
126 #if @GNULIB_ACOSL@
127 # if !@HAVE_ACOSL@ || !@HAVE_DECL_ACOSL@
128 _GL_FUNCDECL_SYS (acosl, long double, (long double x));
129 # endif
130 _GL_CXXALIAS_SYS (acosl, long double, (long double x));
131 _GL_CXXALIASWARN (acosl);
132 #elif defined GNULIB_POSIXCHECK
133 # undef acosl
134 # if HAVE_RAW_DECL_ACOSL
135 _GL_WARN_ON_USE (acosl, "acosl is unportable - "
136                  "use gnulib module mathl for portability");
137 # endif
138 #endif
139
140
141 #if @GNULIB_ASINF@
142 # if !@HAVE_ASINF@
143 #  undef asinf
144 _GL_FUNCDECL_SYS (asinf, float, (float x));
145 # endif
146 _GL_CXXALIAS_SYS (asinf, float, (float x));
147 _GL_CXXALIASWARN (asinf);
148 #elif defined GNULIB_POSIXCHECK
149 # undef asinf
150 # if HAVE_RAW_DECL_ASINF
151 _GL_WARN_ON_USE (asinf, "asinf is unportable - "
152                  "use gnulib module asinf for portability");
153 # endif
154 #endif
155
156 #if @GNULIB_ASINL@
157 # if !@HAVE_ASINL@ || !@HAVE_DECL_ASINL@
158 _GL_FUNCDECL_SYS (asinl, long double, (long double x));
159 # endif
160 _GL_CXXALIAS_SYS (asinl, long double, (long double x));
161 _GL_CXXALIASWARN (asinl);
162 #elif defined GNULIB_POSIXCHECK
163 # undef asinl
164 # if HAVE_RAW_DECL_ASINL
165 _GL_WARN_ON_USE (asinl, "asinl is unportable - "
166                  "use gnulib module mathl for portability");
167 # endif
168 #endif
169
170
171 #if @GNULIB_ATANF@
172 # if !@HAVE_ATANF@
173 #  undef atanf
174 _GL_FUNCDECL_SYS (atanf, float, (float x));
175 # endif
176 _GL_CXXALIAS_SYS (atanf, float, (float x));
177 _GL_CXXALIASWARN (atanf);
178 #elif defined GNULIB_POSIXCHECK
179 # undef atanf
180 # if HAVE_RAW_DECL_ATANF
181 _GL_WARN_ON_USE (atanf, "atanf is unportable - "
182                  "use gnulib module atanf for portability");
183 # endif
184 #endif
185
186 #if @GNULIB_ATANL@
187 # if !@HAVE_ATANL@ || !@HAVE_DECL_ATANL@
188 _GL_FUNCDECL_SYS (atanl, long double, (long double x));
189 # endif
190 _GL_CXXALIAS_SYS (atanl, long double, (long double x));
191 _GL_CXXALIASWARN (atanl);
192 #elif defined GNULIB_POSIXCHECK
193 # undef atanl
194 # if HAVE_RAW_DECL_ATANL
195 _GL_WARN_ON_USE (atanl, "atanl is unportable - "
196                  "use gnulib module mathl for portability");
197 # endif
198 #endif
199
200
201 #if @GNULIB_ATAN2F@
202 # if !@HAVE_ATAN2F@
203 #  undef atan2f
204 _GL_FUNCDECL_SYS (atan2f, float, (float y, float x));
205 # endif
206 _GL_CXXALIAS_SYS (atan2f, float, (float y, float x));
207 _GL_CXXALIASWARN (atan2f);
208 #elif defined GNULIB_POSIXCHECK
209 # undef atan2f
210 # if HAVE_RAW_DECL_ATAN2F
211 _GL_WARN_ON_USE (atan2f, "atan2f is unportable - "
212                  "use gnulib module atan2f for portability");
213 # endif
214 #endif
215
216
217 #if @GNULIB_CEILF@
218 # if @REPLACE_CEILF@
219 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
220 #   undef ceilf
221 #   define ceilf rpl_ceilf
222 #  endif
223 _GL_FUNCDECL_RPL (ceilf, float, (float x));
224 _GL_CXXALIAS_RPL (ceilf, float, (float x));
225 # else
226 #  if !@HAVE_DECL_CEILF@
227 _GL_FUNCDECL_SYS (ceilf, float, (float x));
228 #  endif
229 _GL_CXXALIAS_SYS (ceilf, float, (float x));
230 # endif
231 _GL_CXXALIASWARN (ceilf);
232 #elif defined GNULIB_POSIXCHECK
233 # undef ceilf
234 # if HAVE_RAW_DECL_CEILF
235 _GL_WARN_ON_USE (ceilf, "ceilf is unportable - "
236                  "use gnulib module ceilf for portability");
237 # endif
238 #endif
239
240 #if @GNULIB_CEIL@
241 # if @REPLACE_CEIL@
242 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
243 #   define ceil rpl_ceil
244 #  endif
245 _GL_FUNCDECL_RPL (ceil, double, (double x));
246 _GL_CXXALIAS_RPL (ceil, double, (double x));
247 # else
248 _GL_CXXALIAS_SYS (ceil, double, (double x));
249 # endif
250 _GL_CXXALIASWARN (ceil);
251 #endif
252
253 #if @GNULIB_CEILL@
254 # if @REPLACE_CEILL@
255 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
256 #   undef ceill
257 #   define ceill rpl_ceill
258 #  endif
259 _GL_FUNCDECL_RPL (ceill, long double, (long double x));
260 _GL_CXXALIAS_RPL (ceill, long double, (long double x));
261 # else
262 #  if !@HAVE_DECL_CEILL@
263 _GL_FUNCDECL_SYS (ceill, long double, (long double x));
264 #  endif
265 _GL_CXXALIAS_SYS (ceill, long double, (long double x));
266 # endif
267 _GL_CXXALIASWARN (ceill);
268 #elif defined GNULIB_POSIXCHECK
269 # undef ceill
270 # if HAVE_RAW_DECL_CEILL
271 _GL_WARN_ON_USE (ceill, "ceill is unportable - "
272                  "use gnulib module ceill for portability");
273 # endif
274 #endif
275
276
277 #if @GNULIB_COPYSIGNF@
278 # if !@HAVE_COPYSIGNF@
279 _GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
280 # endif
281 _GL_CXXALIAS_SYS (copysignf, float, (float x, float y));
282 _GL_CXXALIASWARN (copysignf);
283 #elif defined GNULIB_POSIXCHECK
284 # undef copysignf
285 # if HAVE_RAW_DECL_COPYSIGNF
286 _GL_WARN_ON_USE (copysignf, "copysignf is unportable - "
287                  "use gnulib module copysignf for portability");
288 # endif
289 #endif
290
291 #if @GNULIB_COPYSIGN@
292 # if !@HAVE_COPYSIGN@
293 _GL_FUNCDECL_SYS (copysign, double, (double x, double y));
294 # endif
295 _GL_CXXALIAS_SYS (copysign, double, (double x, double y));
296 _GL_CXXALIASWARN (copysign);
297 #elif defined GNULIB_POSIXCHECK
298 # undef copysign
299 # if HAVE_RAW_DECL_COPYSIGN
300 _GL_WARN_ON_USE (copysign, "copysign is unportable - "
301                  "use gnulib module copysign for portability");
302 # endif
303 #endif
304
305 #if @GNULIB_COPYSIGNL@
306 # if !@HAVE_COPYSIGNL@
307 _GL_FUNCDECL_SYS (copysignl, long double, (long double x, long double y));
308 # endif
309 _GL_CXXALIAS_SYS (copysignl, long double, (long double x, long double y));
310 _GL_CXXALIASWARN (copysignl);
311 #elif defined GNULIB_POSIXCHECK
312 # undef copysignl
313 # if HAVE_RAW_DECL_COPYSIGNL
314 _GL_WARN_ON_USE (copysign, "copysignl is unportable - "
315                  "use gnulib module copysignl for portability");
316 # endif
317 #endif
318
319
320 #if @GNULIB_COSF@
321 # if !@HAVE_COSF@
322 #  undef cosf
323 _GL_FUNCDECL_SYS (cosf, float, (float x));
324 # endif
325 _GL_CXXALIAS_SYS (cosf, float, (float x));
326 _GL_CXXALIASWARN (cosf);
327 #elif defined GNULIB_POSIXCHECK
328 # undef cosf
329 # if HAVE_RAW_DECL_COSF
330 _GL_WARN_ON_USE (cosf, "cosf is unportable - "
331                  "use gnulib module cosf for portability");
332 # endif
333 #endif
334
335 #if @GNULIB_COSL@
336 # if !@HAVE_COSL@ || !@HAVE_DECL_COSL@
337 _GL_FUNCDECL_SYS (cosl, long double, (long double x));
338 # endif
339 _GL_CXXALIAS_SYS (cosl, long double, (long double x));
340 _GL_CXXALIASWARN (cosl);
341 #elif defined GNULIB_POSIXCHECK
342 # undef cosl
343 # if HAVE_RAW_DECL_COSL
344 _GL_WARN_ON_USE (cosl, "cosl is unportable - "
345                  "use gnulib module mathl for portability");
346 # endif
347 #endif
348
349
350 #if @GNULIB_COSHF@
351 # if !@HAVE_COSHF@
352 #  undef coshf
353 _GL_FUNCDECL_SYS (coshf, float, (float x));
354 # endif
355 _GL_CXXALIAS_SYS (coshf, float, (float x));
356 _GL_CXXALIASWARN (coshf);
357 #elif defined GNULIB_POSIXCHECK
358 # undef coshf
359 # if HAVE_RAW_DECL_COSHF
360 _GL_WARN_ON_USE (coshf, "coshf is unportable - "
361                  "use gnulib module coshf for portability");
362 # endif
363 #endif
364
365
366 #if @GNULIB_EXPF@
367 # if !@HAVE_EXPF@
368 #  undef expf
369 _GL_FUNCDECL_SYS (expf, float, (float x));
370 # endif
371 _GL_CXXALIAS_SYS (expf, float, (float x));
372 _GL_CXXALIASWARN (expf);
373 #elif defined GNULIB_POSIXCHECK
374 # undef expf
375 # if HAVE_RAW_DECL_EXPF
376 _GL_WARN_ON_USE (expf, "expf is unportable - "
377                  "use gnulib module expf for portability");
378 # endif
379 #endif
380
381 #if @GNULIB_EXPL@
382 # if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
383 _GL_FUNCDECL_SYS (expl, long double, (long double x));
384 # endif
385 _GL_CXXALIAS_SYS (expl, long double, (long double x));
386 _GL_CXXALIASWARN (expl);
387 #elif defined GNULIB_POSIXCHECK
388 # undef expl
389 # if HAVE_RAW_DECL_EXPL
390 _GL_WARN_ON_USE (expl, "expl is unportable - "
391                  "use gnulib module mathl for portability");
392 # endif
393 #endif
394
395
396 #if @GNULIB_FABSF@
397 # if !@HAVE_FABSF@
398 #  undef fabsf
399 _GL_FUNCDECL_SYS (fabsf, float, (float x));
400 # endif
401 _GL_CXXALIAS_SYS (fabsf, float, (float x));
402 _GL_CXXALIASWARN (fabsf);
403 #elif defined GNULIB_POSIXCHECK
404 # undef fabsf
405 # if HAVE_RAW_DECL_FABSF
406 _GL_WARN_ON_USE (fabsf, "fabsf is unportable - "
407                  "use gnulib module fabsf for portability");
408 # endif
409 #endif
410
411
412 #if @GNULIB_FLOORF@
413 # if @REPLACE_FLOORF@
414 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
415 #   undef floorf
416 #   define floorf rpl_floorf
417 #  endif
418 _GL_FUNCDECL_RPL (floorf, float, (float x));
419 _GL_CXXALIAS_RPL (floorf, float, (float x));
420 # else
421 #  if !@HAVE_DECL_FLOORF@
422 _GL_FUNCDECL_SYS (floorf, float, (float x));
423 #  endif
424 _GL_CXXALIAS_SYS (floorf, float, (float x));
425 # endif
426 _GL_CXXALIASWARN (floorf);
427 #elif defined GNULIB_POSIXCHECK
428 # undef floorf
429 # if HAVE_RAW_DECL_FLOORF
430 _GL_WARN_ON_USE (floorf, "floorf is unportable - "
431                  "use gnulib module floorf for portability");
432 # endif
433 #endif
434
435 #if @GNULIB_FLOOR@
436 # if @REPLACE_FLOOR@
437 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
438 #   define floor rpl_floor
439 #  endif
440 _GL_FUNCDECL_RPL (floor, double, (double x));
441 _GL_CXXALIAS_RPL (floor, double, (double x));
442 # else
443 _GL_CXXALIAS_SYS (floor, double, (double x));
444 # endif
445 _GL_CXXALIASWARN (floor);
446 #endif
447
448 #if @GNULIB_FLOORL@
449 # if @REPLACE_FLOORL@
450 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
451 #   undef floorl
452 #   define floorl rpl_floorl
453 #  endif
454 _GL_FUNCDECL_RPL (floorl, long double, (long double x));
455 _GL_CXXALIAS_RPL (floorl, long double, (long double x));
456 # else
457 #  if !@HAVE_DECL_FLOORL@
458 _GL_FUNCDECL_SYS (floorl, long double, (long double x));
459 #  endif
460 _GL_CXXALIAS_SYS (floorl, long double, (long double x));
461 # endif
462 _GL_CXXALIASWARN (floorl);
463 #elif defined GNULIB_POSIXCHECK
464 # undef floorl
465 # if HAVE_RAW_DECL_FLOORL
466 _GL_WARN_ON_USE (floorl, "floorl is unportable - "
467                  "use gnulib module floorl for portability");
468 # endif
469 #endif
470
471
472 #if @GNULIB_FMODF@
473 # if !@HAVE_FMODF@
474 #  undef fmodf
475 _GL_FUNCDECL_SYS (fmodf, float, (float x, float y));
476 # endif
477 _GL_CXXALIAS_SYS (fmodf, float, (float x, float y));
478 _GL_CXXALIASWARN (fmodf);
479 #elif defined GNULIB_POSIXCHECK
480 # undef fmodf
481 # if HAVE_RAW_DECL_FMODF
482 _GL_WARN_ON_USE (fmodf, "fmodf is unportable - "
483                  "use gnulib module fmodf for portability");
484 # endif
485 #endif
486
487
488 /* Write x as
489      x = mantissa * 2^exp
490    where
491      If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
492      If x is zero: mantissa = x, exp = 0.
493      If x is infinite or NaN: mantissa = x, exp unspecified.
494    Store exp in *EXPPTR and return mantissa.  */
495 #if @GNULIB_FREXPF@
496 # if @REPLACE_FREXPF@
497 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
498 #   undef frexpf
499 #   define frexpf rpl_frexpf
500 #  endif
501 _GL_FUNCDECL_RPL (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
502 _GL_CXXALIAS_RPL (frexpf, float, (float x, int *expptr));
503 # else
504 #  if !@HAVE_FREXPF@
505 #   undef frexpf
506 _GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
507 #  endif
508 _GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr));
509 # endif
510 _GL_CXXALIASWARN (frexpf);
511 #elif defined GNULIB_POSIXCHECK
512 # undef frexpf
513 # if HAVE_RAW_DECL_FREXPF
514 _GL_WARN_ON_USE (frexpf, "frexpf is unportable - "
515                  "use gnulib module frexpf for portability");
516 # endif
517 #endif
518
519 /* Write x as
520      x = mantissa * 2^exp
521    where
522      If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
523      If x is zero: mantissa = x, exp = 0.
524      If x is infinite or NaN: mantissa = x, exp unspecified.
525    Store exp in *EXPPTR and return mantissa.  */
526 #if @GNULIB_FREXP@
527 # if @REPLACE_FREXP@
528 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
529 #   define frexp rpl_frexp
530 #  endif
531 _GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2)));
532 _GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
533 # else
534 _GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
535 # endif
536 _GL_CXXALIASWARN (frexp);
537 #elif defined GNULIB_POSIXCHECK
538 # undef frexp
539 /* Assume frexp is always declared.  */
540 _GL_WARN_ON_USE (frexp, "frexp is unportable - "
541                  "use gnulib module frexp for portability");
542 #endif
543
544 /* Write x as
545      x = mantissa * 2^exp
546    where
547      If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
548      If x is zero: mantissa = x, exp = 0.
549      If x is infinite or NaN: mantissa = x, exp unspecified.
550    Store exp in *EXPPTR and return mantissa.  */
551 #if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
552 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
553 #  undef frexpl
554 #  define frexpl rpl_frexpl
555 # endif
556 _GL_FUNCDECL_RPL (frexpl, long double,
557                   (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
558 _GL_CXXALIAS_RPL (frexpl, long double, (long double x, int *expptr));
559 #else
560 # if !@HAVE_DECL_FREXPL@
561 _GL_FUNCDECL_SYS (frexpl, long double,
562                   (long double x, int *expptr) _GL_ARG_NONNULL ((2)));
563 # endif
564 # if @GNULIB_FREXPL@
565 _GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
566 # endif
567 #endif
568 #if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
569 _GL_CXXALIASWARN (frexpl);
570 #endif
571 #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
572 # undef frexpl
573 # if HAVE_RAW_DECL_FREXPL
574 _GL_WARN_ON_USE (frexpl, "frexpl is unportable - "
575                  "use gnulib module frexpl for portability");
576 # endif
577 #endif
578
579
580 /* Return x * 2^exp.  */
581 #if @GNULIB_LDEXPF@
582 # if !@HAVE_LDEXPF@
583 #  undef ldexpf
584 _GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp));
585 # endif
586 _GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp));
587 _GL_CXXALIASWARN (ldexpf);
588 #elif defined GNULIB_POSIXCHECK
589 # undef ldexpf
590 # if HAVE_RAW_DECL_LDEXPF
591 _GL_WARN_ON_USE (ldexpf, "ldexpf is unportable - "
592                  "use gnulib module ldexpf for portability");
593 # endif
594 #endif
595
596 /* Return x * 2^exp.  */
597 #if @GNULIB_LDEXPL@ && @REPLACE_LDEXPL@
598 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
599 #  undef ldexpl
600 #  define ldexpl rpl_ldexpl
601 # endif
602 _GL_FUNCDECL_RPL (ldexpl, long double, (long double x, int exp));
603 _GL_CXXALIAS_RPL (ldexpl, long double, (long double x, int exp));
604 #else
605 # if !@HAVE_DECL_LDEXPL@
606 _GL_FUNCDECL_SYS (ldexpl, long double, (long double x, int exp));
607 # endif
608 # if @GNULIB_LDEXPL@
609 _GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
610 # endif
611 #endif
612 #if @GNULIB_LDEXPL@
613 _GL_CXXALIASWARN (ldexpl);
614 #endif
615 #if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
616 # undef ldexpl
617 # if HAVE_RAW_DECL_LDEXPL
618 _GL_WARN_ON_USE (ldexpl, "ldexpl is unportable - "
619                  "use gnulib module ldexpl for portability");
620 # endif
621 #endif
622
623
624 #if @GNULIB_LOGB@
625 # if !@HAVE_DECL_LOGB@
626 _GL_EXTERN_C double logb (double x);
627 # endif
628 #elif defined GNULIB_POSIXCHECK
629 # undef logb
630 # if HAVE_RAW_DECL_LOGB
631 _GL_WARN_ON_USE (logb, "logb is unportable - "
632                  "use gnulib module logb for portability");
633 # endif
634 #endif
635
636
637 #if @GNULIB_LOGF@
638 # if !@HAVE_LOGF@
639 #  undef logf
640 _GL_FUNCDECL_SYS (logf, float, (float x));
641 # endif
642 _GL_CXXALIAS_SYS (logf, float, (float x));
643 _GL_CXXALIASWARN (logf);
644 #elif defined GNULIB_POSIXCHECK
645 # undef logf
646 # if HAVE_RAW_DECL_LOGF
647 _GL_WARN_ON_USE (logf, "logf is unportable - "
648                  "use gnulib module logf for portability");
649 # endif
650 #endif
651
652 #if @GNULIB_LOGL@
653 # if !@HAVE_LOGL@ || !@HAVE_DECL_LOGL@
654 _GL_FUNCDECL_SYS (logl, long double, (long double x));
655 # endif
656 _GL_CXXALIAS_SYS (logl, long double, (long double x));
657 _GL_CXXALIASWARN (logl);
658 #elif defined GNULIB_POSIXCHECK
659 # undef logl
660 # if HAVE_RAW_DECL_LOGL
661 _GL_WARN_ON_USE (logl, "logl is unportable - "
662                  "use gnulib module mathl for portability");
663 # endif
664 #endif
665
666
667 #if @GNULIB_LOG10F@
668 # if !@HAVE_LOG10F@
669 #  undef log10f
670 _GL_FUNCDECL_SYS (log10f, float, (float x));
671 # endif
672 _GL_CXXALIAS_SYS (log10f, float, (float x));
673 _GL_CXXALIASWARN (log10f);
674 #elif defined GNULIB_POSIXCHECK
675 # undef log10f
676 # if HAVE_RAW_DECL_LOG10F
677 _GL_WARN_ON_USE (log10f, "log10f is unportable - "
678                  "use gnulib module log10f for portability");
679 # endif
680 #endif
681
682
683 #if @GNULIB_MODFF@
684 # if !@HAVE_MODFF@
685 #  undef modff
686 _GL_FUNCDECL_SYS (modff, float, (float x, float *iptr) _GL_ARG_NONNULL ((2)));
687 # endif
688 _GL_CXXALIAS_SYS (modff, float, (float x, float *iptr));
689 _GL_CXXALIASWARN (modff);
690 #elif defined GNULIB_POSIXCHECK
691 # undef modff
692 # if HAVE_RAW_DECL_MODFF
693 _GL_WARN_ON_USE (modff, "modff is unportable - "
694                  "use gnulib module modff for portability");
695 # endif
696 #endif
697
698
699 #if @GNULIB_POWF@
700 # if !@HAVE_POWF@
701 #  undef powf
702 _GL_FUNCDECL_SYS (powf, float, (float x, float y));
703 # endif
704 _GL_CXXALIAS_SYS (powf, float, (float x, float y));
705 _GL_CXXALIASWARN (powf);
706 #elif defined GNULIB_POSIXCHECK
707 # undef powf
708 # if HAVE_RAW_DECL_POWF
709 _GL_WARN_ON_USE (powf, "powf is unportable - "
710                  "use gnulib module powf for portability");
711 # endif
712 #endif
713
714
715 #if @GNULIB_ROUNDF@
716 # if @REPLACE_ROUNDF@
717 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
718 #   undef roundf
719 #   define roundf rpl_roundf
720 #  endif
721 _GL_FUNCDECL_RPL (roundf, float, (float x));
722 _GL_CXXALIAS_RPL (roundf, float, (float x));
723 # else
724 #  if !@HAVE_DECL_ROUNDF@
725 _GL_FUNCDECL_SYS (roundf, float, (float x));
726 #  endif
727 _GL_CXXALIAS_SYS (roundf, float, (float x));
728 # endif
729 _GL_CXXALIASWARN (roundf);
730 #elif defined GNULIB_POSIXCHECK
731 # undef roundf
732 # if HAVE_RAW_DECL_ROUNDF
733 _GL_WARN_ON_USE (roundf, "roundf is unportable - "
734                  "use gnulib module roundf for portability");
735 # endif
736 #endif
737
738 #if @GNULIB_ROUND@
739 # if @REPLACE_ROUND@
740 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
741 #   undef round
742 #   define round rpl_round
743 #  endif
744 _GL_FUNCDECL_RPL (round, double, (double x));
745 _GL_CXXALIAS_RPL (round, double, (double x));
746 # else
747 #  if !@HAVE_DECL_ROUND@
748 _GL_FUNCDECL_SYS (round, double, (double x));
749 #  endif
750 _GL_CXXALIAS_SYS (round, double, (double x));
751 # endif
752 _GL_CXXALIASWARN (round);
753 #elif defined GNULIB_POSIXCHECK
754 # undef round
755 # if HAVE_RAW_DECL_ROUND
756 _GL_WARN_ON_USE (round, "round is unportable - "
757                  "use gnulib module round for portability");
758 # endif
759 #endif
760
761 #if @GNULIB_ROUNDL@
762 # if @REPLACE_ROUNDL@
763 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
764 #   undef roundl
765 #   define roundl rpl_roundl
766 #  endif
767 _GL_FUNCDECL_RPL (roundl, long double, (long double x));
768 _GL_CXXALIAS_RPL (roundl, long double, (long double x));
769 # else
770 #  if !@HAVE_DECL_ROUNDL@
771 _GL_FUNCDECL_SYS (roundl, long double, (long double x));
772 #  endif
773 _GL_CXXALIAS_SYS (roundl, long double, (long double x));
774 # endif
775 _GL_CXXALIASWARN (roundl);
776 #elif defined GNULIB_POSIXCHECK
777 # undef roundl
778 # if HAVE_RAW_DECL_ROUNDL
779 _GL_WARN_ON_USE (roundl, "roundl is unportable - "
780                  "use gnulib module roundl for portability");
781 # endif
782 #endif
783
784
785 #if @GNULIB_SINF@
786 # if !@HAVE_SINF@
787 #  undef sinf
788 _GL_FUNCDECL_SYS (sinf, float, (float x));
789 # endif
790 _GL_CXXALIAS_SYS (sinf, float, (float x));
791 _GL_CXXALIASWARN (sinf);
792 #elif defined GNULIB_POSIXCHECK
793 # undef sinf
794 # if HAVE_RAW_DECL_SINF
795 _GL_WARN_ON_USE (sinf, "sinf is unportable - "
796                  "use gnulib module sinf for portability");
797 # endif
798 #endif
799
800 #if @GNULIB_SINL@
801 # if !@HAVE_SINL@ || !@HAVE_DECL_SINL@
802 _GL_FUNCDECL_SYS (sinl, long double, (long double x));
803 # endif
804 _GL_CXXALIAS_SYS (sinl, long double, (long double x));
805 _GL_CXXALIASWARN (sinl);
806 #elif defined GNULIB_POSIXCHECK
807 # undef sinl
808 # if HAVE_RAW_DECL_SINL
809 _GL_WARN_ON_USE (sinl, "sinl is unportable - "
810                  "use gnulib module mathl for portability");
811 # endif
812 #endif
813
814
815 #if @GNULIB_SINHF@
816 # if !@HAVE_SINHF@
817 #  undef sinhf
818 _GL_FUNCDECL_SYS (sinhf, float, (float x));
819 # endif
820 _GL_CXXALIAS_SYS (sinhf, float, (float x));
821 _GL_CXXALIASWARN (sinhf);
822 #elif defined GNULIB_POSIXCHECK
823 # undef sinhf
824 # if HAVE_RAW_DECL_SINHF
825 _GL_WARN_ON_USE (sinhf, "sinhf is unportable - "
826                  "use gnulib module sinhf for portability");
827 # endif
828 #endif
829
830
831 #if @GNULIB_SQRTF@
832 # if !@HAVE_SQRTF@
833 #  undef sqrtf
834 _GL_FUNCDECL_SYS (sqrtf, float, (float x));
835 # endif
836 _GL_CXXALIAS_SYS (sqrtf, float, (float x));
837 _GL_CXXALIASWARN (sqrtf);
838 #elif defined GNULIB_POSIXCHECK
839 # undef sqrtf
840 # if HAVE_RAW_DECL_SQRTF
841 _GL_WARN_ON_USE (sqrtf, "sqrtf is unportable - "
842                  "use gnulib module sqrtf for portability");
843 # endif
844 #endif
845
846 #if @GNULIB_SQRTL@
847 # if !@HAVE_SQRTL@ || !@HAVE_DECL_SQRTL@
848 _GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
849 # endif
850 _GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
851 _GL_CXXALIASWARN (sqrtl);
852 #elif defined GNULIB_POSIXCHECK
853 # undef sqrtl
854 # if HAVE_RAW_DECL_SQRTL
855 _GL_WARN_ON_USE (sqrtl, "sqrtl is unportable - "
856                  "use gnulib module mathl for portability");
857 # endif
858 #endif
859
860
861 #if @GNULIB_TANF@
862 # if !@HAVE_TANF@
863 #  undef tanf
864 _GL_FUNCDECL_SYS (tanf, float, (float x));
865 # endif
866 _GL_CXXALIAS_SYS (tanf, float, (float x));
867 _GL_CXXALIASWARN (tanf);
868 #elif defined GNULIB_POSIXCHECK
869 # undef tanf
870 # if HAVE_RAW_DECL_TANF
871 _GL_WARN_ON_USE (tanf, "tanf is unportable - "
872                  "use gnulib module tanf for portability");
873 # endif
874 #endif
875
876 #if @GNULIB_TANL@
877 # if !@HAVE_TANL@ || !@HAVE_DECL_TANL@
878 _GL_FUNCDECL_SYS (tanl, long double, (long double x));
879 # endif
880 _GL_CXXALIAS_SYS (tanl, long double, (long double x));
881 _GL_CXXALIASWARN (tanl);
882 #elif defined GNULIB_POSIXCHECK
883 # undef tanl
884 # if HAVE_RAW_DECL_TANL
885 _GL_WARN_ON_USE (tanl, "tanl is unportable - "
886                  "use gnulib module mathl for portability");
887 # endif
888 #endif
889
890
891 #if @GNULIB_TANHF@
892 # if !@HAVE_TANHF@
893 #  undef tanhf
894 _GL_FUNCDECL_SYS (tanhf, float, (float x));
895 # endif
896 _GL_CXXALIAS_SYS (tanhf, float, (float x));
897 _GL_CXXALIASWARN (tanhf);
898 #elif defined GNULIB_POSIXCHECK
899 # undef tanhf
900 # if HAVE_RAW_DECL_TANHF
901 _GL_WARN_ON_USE (tanhf, "tanhf is unportable - "
902                  "use gnulib module tanhf for portability");
903 # endif
904 #endif
905
906
907 #if @GNULIB_TRUNCF@
908 # if @REPLACE_TRUNCF@
909 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
910 #   define truncf rpl_truncf
911 #  endif
912 _GL_FUNCDECL_RPL (truncf, float, (float x));
913 _GL_CXXALIAS_RPL (truncf, float, (float x));
914 # else
915 #  if !@HAVE_DECL_TRUNCF@
916 _GL_FUNCDECL_SYS (truncf, float, (float x));
917 #  endif
918 _GL_CXXALIAS_SYS (truncf, float, (float x));
919 # endif
920 _GL_CXXALIASWARN (truncf);
921 #elif defined GNULIB_POSIXCHECK
922 # undef truncf
923 # if HAVE_RAW_DECL_TRUNCF
924 _GL_WARN_ON_USE (truncf, "truncf is unportable - "
925                  "use gnulib module truncf for portability");
926 # endif
927 #endif
928
929 #if @GNULIB_TRUNC@
930 # if @REPLACE_TRUNC@
931 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
932 #   define trunc rpl_trunc
933 #  endif
934 _GL_FUNCDECL_RPL (trunc, double, (double x));
935 _GL_CXXALIAS_RPL (trunc, double, (double x));
936 # else
937 #  if !@HAVE_DECL_TRUNC@
938 _GL_FUNCDECL_SYS (trunc, double, (double x));
939 #  endif
940 _GL_CXXALIAS_SYS (trunc, double, (double x));
941 # endif
942 _GL_CXXALIASWARN (trunc);
943 #elif defined GNULIB_POSIXCHECK
944 # undef trunc
945 # if HAVE_RAW_DECL_TRUNC
946 _GL_WARN_ON_USE (trunc, "trunc is unportable - "
947                  "use gnulib module trunc for portability");
948 # endif
949 #endif
950
951 #if @GNULIB_TRUNCL@
952 # if @REPLACE_TRUNCL@
953 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
954 #   undef truncl
955 #   define truncl rpl_truncl
956 #  endif
957 _GL_FUNCDECL_RPL (truncl, long double, (long double x));
958 _GL_CXXALIAS_RPL (truncl, long double, (long double x));
959 # else
960 #  if !@HAVE_DECL_TRUNCL@
961 _GL_FUNCDECL_SYS (truncl, long double, (long double x));
962 #  endif
963 _GL_CXXALIAS_SYS (truncl, long double, (long double x));
964 # endif
965 _GL_CXXALIASWARN (truncl);
966 #elif defined GNULIB_POSIXCHECK
967 # undef truncl
968 # if HAVE_RAW_DECL_TRUNCL
969 _GL_WARN_ON_USE (truncl, "truncl is unportable - "
970                  "use gnulib module truncl for portability");
971 # endif
972 #endif
973
974
975 /* Definitions of function-like macros come here, after the function
976    declarations.  */
977
978
979 #if @GNULIB_ISFINITE@
980 # if @REPLACE_ISFINITE@
981 _GL_EXTERN_C int gl_isfinitef (float x);
982 _GL_EXTERN_C int gl_isfinited (double x);
983 _GL_EXTERN_C int gl_isfinitel (long double x);
984 #  undef isfinite
985 #  define isfinite(x) \
986    (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
987     sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
988     gl_isfinitef (x))
989 # endif
990 #elif defined GNULIB_POSIXCHECK
991 # if defined isfinite
992 _GL_WARN_REAL_FLOATING_DECL (isfinite);
993 #  undef isfinite
994 #  define isfinite(x) _GL_WARN_REAL_FLOATING_IMPL (isfinite, x)
995 # endif
996 #endif
997
998
999 #if @GNULIB_ISINF@
1000 # if @REPLACE_ISINF@
1001 _GL_EXTERN_C int gl_isinff (float x);
1002 _GL_EXTERN_C int gl_isinfd (double x);
1003 _GL_EXTERN_C int gl_isinfl (long double x);
1004 #  undef isinf
1005 #  define isinf(x) \
1006    (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
1007     sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
1008     gl_isinff (x))
1009 # endif
1010 #elif defined GNULIB_POSIXCHECK
1011 # if defined isinf
1012 _GL_WARN_REAL_FLOATING_DECL (isinf);
1013 #  undef isinf
1014 #  define isinf(x) _GL_WARN_REAL_FLOATING_IMPL (isinf, x)
1015 # endif
1016 #endif
1017
1018
1019 #if @GNULIB_ISNANF@
1020 /* Test for NaN for 'float' numbers.  */
1021 # if @HAVE_ISNANF@
1022 /* The original <math.h> included above provides a declaration of isnan macro
1023    or (older) isnanf function.  */
1024 #  if __GNUC__ >= 4
1025     /* GCC 4.0 and newer provides three built-ins for isnan.  */
1026 #   undef isnanf
1027 #   define isnanf(x) __builtin_isnanf ((float)(x))
1028 #  elif defined isnan
1029 #   undef isnanf
1030 #   define isnanf(x) isnan ((float)(x))
1031 #  endif
1032 # else
1033 /* Test whether X is a NaN.  */
1034 #  undef isnanf
1035 #  define isnanf rpl_isnanf
1036 _GL_EXTERN_C int isnanf (float x);
1037 # endif
1038 #endif
1039
1040 #if @GNULIB_ISNAND@
1041 /* Test for NaN for 'double' numbers.
1042    This function is a gnulib extension, unlike isnan() which applied only
1043    to 'double' numbers earlier but now is a type-generic macro.  */
1044 # if @HAVE_ISNAND@
1045 /* The original <math.h> included above provides a declaration of isnan
1046    macro.  */
1047 #  if __GNUC__ >= 4
1048     /* GCC 4.0 and newer provides three built-ins for isnan.  */
1049 #   undef isnand
1050 #   define isnand(x) __builtin_isnan ((double)(x))
1051 #  else
1052 #   undef isnand
1053 #   define isnand(x) isnan ((double)(x))
1054 #  endif
1055 # else
1056 /* Test whether X is a NaN.  */
1057 #  undef isnand
1058 #  define isnand rpl_isnand
1059 _GL_EXTERN_C int isnand (double x);
1060 # endif
1061 #endif
1062
1063 #if @GNULIB_ISNANL@
1064 /* Test for NaN for 'long double' numbers.  */
1065 # if @HAVE_ISNANL@
1066 /* The original <math.h> included above provides a declaration of isnan
1067    macro or (older) isnanl function.  */
1068 #  if __GNUC__ >= 4
1069     /* GCC 4.0 and newer provides three built-ins for isnan.  */
1070 #   undef isnanl
1071 #   define isnanl(x) __builtin_isnanl ((long double)(x))
1072 #  elif defined isnan
1073 #   undef isnanl
1074 #   define isnanl(x) isnan ((long double)(x))
1075 #  endif
1076 # else
1077 /* Test whether X is a NaN.  */
1078 #  undef isnanl
1079 #  define isnanl rpl_isnanl
1080 _GL_EXTERN_C int isnanl (long double x);
1081 # endif
1082 #endif
1083
1084 /* This must come *after* the snippets for GNULIB_ISNANF and GNULIB_ISNANL!  */
1085 #if @GNULIB_ISNAN@
1086 # if @REPLACE_ISNAN@
1087 /* We can't just use the isnanf macro (e.g.) as exposed by
1088    isnanf.h (e.g.) here, because those may end up being macros
1089    that recursively expand back to isnan.  So use the gnulib
1090    replacements for them directly. */
1091 #  if @HAVE_ISNANF@ && __GNUC__ >= 4
1092 #   define gl_isnan_f(x) __builtin_isnanf ((float)(x))
1093 #  else
1094 _GL_EXTERN_C int rpl_isnanf (float x);
1095 #   define gl_isnan_f(x) rpl_isnanf (x)
1096 #  endif
1097 #  if @HAVE_ISNAND@ && __GNUC__ >= 4
1098 #   define gl_isnan_d(x) __builtin_isnan ((double)(x))
1099 #  else
1100 _GL_EXTERN_C int rpl_isnand (double x);
1101 #   define gl_isnan_d(x) rpl_isnand (x)
1102 #  endif
1103 #  if @HAVE_ISNANL@ && __GNUC__ >= 4
1104 #   define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
1105 #  else
1106 _GL_EXTERN_C int rpl_isnanl (long double x);
1107 #   define gl_isnan_l(x) rpl_isnanl (x)
1108 #  endif
1109 #  undef isnan
1110 #  define isnan(x) \
1111    (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
1112     sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
1113     gl_isnan_f (x))
1114 # elif __GNUC__ >= 4
1115 #  undef isnan
1116 #  define isnan(x) \
1117    (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
1118     sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
1119     __builtin_isnanf ((float)(x)))
1120 # endif
1121 /* Ensure isnan is a macro.  */
1122 # ifndef isnan
1123 #  define isnan isnan
1124 # endif
1125 #elif defined GNULIB_POSIXCHECK
1126 # if defined isnan
1127 _GL_WARN_REAL_FLOATING_DECL (isnan);
1128 #  undef isnan
1129 #  define isnan(x) _GL_WARN_REAL_FLOATING_IMPL (isnan, x)
1130 # endif
1131 #endif
1132
1133
1134 #if @GNULIB_SIGNBIT@
1135 # if @REPLACE_SIGNBIT_USING_GCC@
1136 #  undef signbit
1137    /* GCC 4.0 and newer provides three built-ins for signbit.  */
1138 #  define signbit(x) \
1139    (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
1140     sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
1141     __builtin_signbitf (x))
1142 # endif
1143 # if @REPLACE_SIGNBIT@
1144 #  undef signbit
1145 _GL_EXTERN_C int gl_signbitf (float arg);
1146 _GL_EXTERN_C int gl_signbitd (double arg);
1147 _GL_EXTERN_C int gl_signbitl (long double arg);
1148 #  if __GNUC__ >= 2 && !__STRICT_ANSI__
1149 #   define _GL_NUM_UINT_WORDS(type) \
1150       ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
1151 #   if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
1152 #    define gl_signbitf_OPTIMIZED_MACRO
1153 #    define gl_signbitf(arg) \
1154        ({ union { float _value;                                         \
1155                   unsigned int _word[_GL_NUM_UINT_WORDS (float)];       \
1156                 } _m;                                                   \
1157           _m._value = (arg);                                            \
1158           (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1;          \
1159         })
1160 #   endif
1161 #   if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
1162 #    define gl_signbitd_OPTIMIZED_MACRO
1163 #    define gl_signbitd(arg) \
1164        ({ union { double _value;                                        \
1165                   unsigned int _word[_GL_NUM_UINT_WORDS (double)];      \
1166                 } _m;                                                   \
1167           _m._value = (arg);                                            \
1168           (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1;          \
1169         })
1170 #   endif
1171 #   if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
1172 #    define gl_signbitl_OPTIMIZED_MACRO
1173 #    define gl_signbitl(arg) \
1174        ({ union { long double _value;                                   \
1175                   unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
1176                 } _m;                                                   \
1177           _m._value = (arg);                                            \
1178           (_m._word[LDBL_SIGNBIT_WORD] >> LDBL_SIGNBIT_BIT) & 1;        \
1179         })
1180 #   endif
1181 #  endif
1182 #  define signbit(x) \
1183    (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
1184     sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
1185     gl_signbitf (x))
1186 # endif
1187 #elif defined GNULIB_POSIXCHECK
1188 # if defined signbit
1189 _GL_WARN_REAL_FLOATING_DECL (signbit);
1190 #  undef signbit
1191 #  define signbit(x) _GL_WARN_REAL_FLOATING_IMPL (signbit, x)
1192 # endif
1193 #endif
1194
1195
1196 #endif /* _@GUARD_PREFIX@_MATH_H */
1197 #endif /* _@GUARD_PREFIX@_MATH_H */