]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/c_global/cmath
Remove obsolete Solaris 8 support
[thirdparty/gcc.git] / libstdc++-v3 / include / c_global / cmath
1 // -*- C++ -*- C forwarding header.
2
3 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 // 2006, 2007, 2008, 2009, 2010, 2011, 2012
5 // Free Software Foundation, Inc.
6 //
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
11 // any later version.
12
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17
18 // Under Section 7 of GPL version 3, you are granted additional
19 // permissions described in the GCC Runtime Library Exception, version
20 // 3.1, as published by the Free Software Foundation.
21
22 // You should have received a copy of the GNU General Public License and
23 // a copy of the GCC Runtime Library Exception along with this program;
24 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 // <http://www.gnu.org/licenses/>.
26
27 /** @file include/cmath
28 * This is a Standard C++ Library file. You should @c \#include this file
29 * in your programs, rather than any of the @a *.h implementation files.
30 *
31 * This is the C++ version of the Standard C Library header @c math.h,
32 * and its contents are (mostly) the same as that header, but are all
33 * contained in the namespace @c std (except for names which are defined
34 * as macros in C).
35 */
36
37 //
38 // ISO C++ 14882: 26.5 C library
39 //
40
41 #pragma GCC system_header
42
43 #include <bits/c++config.h>
44 #include <bits/cpp_type_traits.h>
45 #include <ext/type_traits.h>
46 #include <math.h>
47
48 #ifndef _GLIBCXX_CMATH
49 #define _GLIBCXX_CMATH 1
50
51 // Get rid of those macros defined in <math.h> in lieu of real functions.
52 #undef abs
53 #undef div
54 #undef acos
55 #undef asin
56 #undef atan
57 #undef atan2
58 #undef ceil
59 #undef cos
60 #undef cosh
61 #undef exp
62 #undef fabs
63 #undef floor
64 #undef fmod
65 #undef frexp
66 #undef ldexp
67 #undef log
68 #undef log10
69 #undef modf
70 #undef pow
71 #undef sin
72 #undef sinh
73 #undef sqrt
74 #undef tan
75 #undef tanh
76
77 namespace std _GLIBCXX_VISIBILITY(default)
78 {
79 _GLIBCXX_BEGIN_NAMESPACE_VERSION
80
81 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
82 inline _GLIBCXX_CONSTEXPR double
83 abs(double __x)
84 { return __builtin_fabs(__x); }
85 #endif
86
87 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
88 inline _GLIBCXX_CONSTEXPR float
89 abs(float __x)
90 { return __builtin_fabsf(__x); }
91
92 inline _GLIBCXX_CONSTEXPR long double
93 abs(long double __x)
94 { return __builtin_fabsl(__x); }
95 #endif
96
97 template<typename _Tp>
98 inline _GLIBCXX_CONSTEXPR
99 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
100 double>::__type
101 abs(_Tp __x)
102 { return __builtin_fabs(__x); }
103
104 using ::acos;
105
106 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
107 inline _GLIBCXX_CONSTEXPR float
108 acos(float __x)
109 { return __builtin_acosf(__x); }
110
111 inline _GLIBCXX_CONSTEXPR long double
112 acos(long double __x)
113 { return __builtin_acosl(__x); }
114 #endif
115
116 template<typename _Tp>
117 inline _GLIBCXX_CONSTEXPR
118 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
119 double>::__type
120 acos(_Tp __x)
121 { return __builtin_acos(__x); }
122
123 using ::asin;
124
125 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
126 inline _GLIBCXX_CONSTEXPR float
127 asin(float __x)
128 { return __builtin_asinf(__x); }
129
130 inline _GLIBCXX_CONSTEXPR long double
131 asin(long double __x)
132 { return __builtin_asinl(__x); }
133 #endif
134
135 template<typename _Tp>
136 inline _GLIBCXX_CONSTEXPR
137 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
138 double>::__type
139 asin(_Tp __x)
140 { return __builtin_asin(__x); }
141
142 using ::atan;
143
144 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
145 inline _GLIBCXX_CONSTEXPR float
146 atan(float __x)
147 { return __builtin_atanf(__x); }
148
149 inline _GLIBCXX_CONSTEXPR long double
150 atan(long double __x)
151 { return __builtin_atanl(__x); }
152 #endif
153
154 template<typename _Tp>
155 inline _GLIBCXX_CONSTEXPR
156 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
157 double>::__type
158 atan(_Tp __x)
159 { return __builtin_atan(__x); }
160
161 using ::atan2;
162
163 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
164 inline _GLIBCXX_CONSTEXPR float
165 atan2(float __y, float __x)
166 { return __builtin_atan2f(__y, __x); }
167
168 inline _GLIBCXX_CONSTEXPR long double
169 atan2(long double __y, long double __x)
170 { return __builtin_atan2l(__y, __x); }
171 #endif
172
173 template<typename _Tp, typename _Up>
174 inline _GLIBCXX_CONSTEXPR
175 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
176 atan2(_Tp __y, _Up __x)
177 {
178 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
179 return atan2(__type(__y), __type(__x));
180 }
181
182 using ::ceil;
183
184 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
185 inline _GLIBCXX_CONSTEXPR float
186 ceil(float __x)
187 { return __builtin_ceilf(__x); }
188
189 inline _GLIBCXX_CONSTEXPR long double
190 ceil(long double __x)
191 { return __builtin_ceill(__x); }
192 #endif
193
194 template<typename _Tp>
195 inline _GLIBCXX_CONSTEXPR
196 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
197 double>::__type
198 ceil(_Tp __x)
199 { return __builtin_ceil(__x); }
200
201 using ::cos;
202
203 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
204 inline _GLIBCXX_CONSTEXPR float
205 cos(float __x)
206 { return __builtin_cosf(__x); }
207
208 inline _GLIBCXX_CONSTEXPR long double
209 cos(long double __x)
210 { return __builtin_cosl(__x); }
211 #endif
212
213 template<typename _Tp>
214 inline _GLIBCXX_CONSTEXPR
215 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
216 double>::__type
217 cos(_Tp __x)
218 { return __builtin_cos(__x); }
219
220 using ::cosh;
221
222 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
223 inline _GLIBCXX_CONSTEXPR float
224 cosh(float __x)
225 { return __builtin_coshf(__x); }
226
227 inline _GLIBCXX_CONSTEXPR long double
228 cosh(long double __x)
229 { return __builtin_coshl(__x); }
230 #endif
231
232 template<typename _Tp>
233 inline _GLIBCXX_CONSTEXPR
234 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
235 double>::__type
236 cosh(_Tp __x)
237 { return __builtin_cosh(__x); }
238
239 using ::exp;
240
241 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
242 inline _GLIBCXX_CONSTEXPR float
243 exp(float __x)
244 { return __builtin_expf(__x); }
245
246 inline _GLIBCXX_CONSTEXPR long double
247 exp(long double __x)
248 { return __builtin_expl(__x); }
249 #endif
250
251 template<typename _Tp>
252 inline _GLIBCXX_CONSTEXPR
253 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
254 double>::__type
255 exp(_Tp __x)
256 { return __builtin_exp(__x); }
257
258 using ::fabs;
259
260 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
261 inline _GLIBCXX_CONSTEXPR float
262 fabs(float __x)
263 { return __builtin_fabsf(__x); }
264
265 inline _GLIBCXX_CONSTEXPR long double
266 fabs(long double __x)
267 { return __builtin_fabsl(__x); }
268 #endif
269
270 template<typename _Tp>
271 inline _GLIBCXX_CONSTEXPR
272 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
273 double>::__type
274 fabs(_Tp __x)
275 { return __builtin_fabs(__x); }
276
277 using ::floor;
278
279 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
280 inline _GLIBCXX_CONSTEXPR float
281 floor(float __x)
282 { return __builtin_floorf(__x); }
283
284 inline _GLIBCXX_CONSTEXPR long double
285 floor(long double __x)
286 { return __builtin_floorl(__x); }
287 #endif
288
289 template<typename _Tp>
290 inline _GLIBCXX_CONSTEXPR
291 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
292 double>::__type
293 floor(_Tp __x)
294 { return __builtin_floor(__x); }
295
296 using ::fmod;
297
298 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
299 inline _GLIBCXX_CONSTEXPR float
300 fmod(float __x, float __y)
301 { return __builtin_fmodf(__x, __y); }
302
303 inline _GLIBCXX_CONSTEXPR long double
304 fmod(long double __x, long double __y)
305 { return __builtin_fmodl(__x, __y); }
306 #endif
307
308 template<typename _Tp, typename _Up>
309 inline _GLIBCXX_CONSTEXPR
310 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
311 fmod(_Tp __x, _Up __y)
312 {
313 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
314 return fmod(__type(__x), __type(__y));
315 }
316
317 using ::frexp;
318
319 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
320 inline float
321 frexp(float __x, int* __exp)
322 { return __builtin_frexpf(__x, __exp); }
323
324 inline long double
325 frexp(long double __x, int* __exp)
326 { return __builtin_frexpl(__x, __exp); }
327 #endif
328
329 template<typename _Tp>
330 inline _GLIBCXX_CONSTEXPR
331 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
332 double>::__type
333 frexp(_Tp __x, int* __exp)
334 { return __builtin_frexp(__x, __exp); }
335
336 using ::ldexp;
337
338 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
339 inline _GLIBCXX_CONSTEXPR float
340 ldexp(float __x, int __exp)
341 { return __builtin_ldexpf(__x, __exp); }
342
343 inline _GLIBCXX_CONSTEXPR long double
344 ldexp(long double __x, int __exp)
345 { return __builtin_ldexpl(__x, __exp); }
346 #endif
347
348 template<typename _Tp>
349 inline _GLIBCXX_CONSTEXPR
350 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
351 double>::__type
352 ldexp(_Tp __x, int __exp)
353 { return __builtin_ldexp(__x, __exp); }
354
355 using ::log;
356
357 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
358 inline _GLIBCXX_CONSTEXPR float
359 log(float __x)
360 { return __builtin_logf(__x); }
361
362 inline _GLIBCXX_CONSTEXPR long double
363 log(long double __x)
364 { return __builtin_logl(__x); }
365 #endif
366
367 template<typename _Tp>
368 inline _GLIBCXX_CONSTEXPR
369 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
370 double>::__type
371 log(_Tp __x)
372 { return __builtin_log(__x); }
373
374 using ::log10;
375
376 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
377 inline _GLIBCXX_CONSTEXPR float
378 log10(float __x)
379 { return __builtin_log10f(__x); }
380
381 inline _GLIBCXX_CONSTEXPR long double
382 log10(long double __x)
383 { return __builtin_log10l(__x); }
384 #endif
385
386 template<typename _Tp>
387 inline _GLIBCXX_CONSTEXPR
388 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
389 double>::__type
390 log10(_Tp __x)
391 { return __builtin_log10(__x); }
392
393 using ::modf;
394
395 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
396 inline float
397 modf(float __x, float* __iptr)
398 { return __builtin_modff(__x, __iptr); }
399
400 inline long double
401 modf(long double __x, long double* __iptr)
402 { return __builtin_modfl(__x, __iptr); }
403 #endif
404
405 using ::pow;
406
407 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
408 inline _GLIBCXX_CONSTEXPR float
409 pow(float __x, float __y)
410 { return __builtin_powf(__x, __y); }
411
412 inline _GLIBCXX_CONSTEXPR long double
413 pow(long double __x, long double __y)
414 { return __builtin_powl(__x, __y); }
415
416 #ifndef __GXX_EXPERIMENTAL_CXX0X__
417 // _GLIBCXX_RESOLVE_LIB_DEFECTS
418 // DR 550. What should the return type of pow(float,int) be?
419 inline double
420 pow(double __x, int __i)
421 { return __builtin_powi(__x, __i); }
422
423 inline float
424 pow(float __x, int __n)
425 { return __builtin_powif(__x, __n); }
426
427 inline long double
428 pow(long double __x, int __n)
429 { return __builtin_powil(__x, __n); }
430 #endif
431 #endif
432
433 template<typename _Tp, typename _Up>
434 inline _GLIBCXX_CONSTEXPR
435 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
436 pow(_Tp __x, _Up __y)
437 {
438 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
439 return pow(__type(__x), __type(__y));
440 }
441
442 using ::sin;
443
444 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
445 inline _GLIBCXX_CONSTEXPR float
446 sin(float __x)
447 { return __builtin_sinf(__x); }
448
449 inline _GLIBCXX_CONSTEXPR long double
450 sin(long double __x)
451 { return __builtin_sinl(__x); }
452 #endif
453
454 template<typename _Tp>
455 inline _GLIBCXX_CONSTEXPR
456 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
457 double>::__type
458 sin(_Tp __x)
459 { return __builtin_sin(__x); }
460
461 using ::sinh;
462
463 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
464 inline _GLIBCXX_CONSTEXPR float
465 sinh(float __x)
466 { return __builtin_sinhf(__x); }
467
468 inline _GLIBCXX_CONSTEXPR long double
469 sinh(long double __x)
470 { return __builtin_sinhl(__x); }
471 #endif
472
473 template<typename _Tp>
474 inline _GLIBCXX_CONSTEXPR
475 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
476 double>::__type
477 sinh(_Tp __x)
478 { return __builtin_sinh(__x); }
479
480 using ::sqrt;
481
482 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
483 inline _GLIBCXX_CONSTEXPR float
484 sqrt(float __x)
485 { return __builtin_sqrtf(__x); }
486
487 inline _GLIBCXX_CONSTEXPR long double
488 sqrt(long double __x)
489 { return __builtin_sqrtl(__x); }
490 #endif
491
492 template<typename _Tp>
493 inline _GLIBCXX_CONSTEXPR
494 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
495 double>::__type
496 sqrt(_Tp __x)
497 { return __builtin_sqrt(__x); }
498
499 using ::tan;
500
501 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
502 inline _GLIBCXX_CONSTEXPR float
503 tan(float __x)
504 { return __builtin_tanf(__x); }
505
506 inline _GLIBCXX_CONSTEXPR long double
507 tan(long double __x)
508 { return __builtin_tanl(__x); }
509 #endif
510
511 template<typename _Tp>
512 inline _GLIBCXX_CONSTEXPR
513 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
514 double>::__type
515 tan(_Tp __x)
516 { return __builtin_tan(__x); }
517
518 using ::tanh;
519
520 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
521 inline _GLIBCXX_CONSTEXPR float
522 tanh(float __x)
523 { return __builtin_tanhf(__x); }
524
525 inline _GLIBCXX_CONSTEXPR long double
526 tanh(long double __x)
527 { return __builtin_tanhl(__x); }
528 #endif
529
530 template<typename _Tp>
531 inline _GLIBCXX_CONSTEXPR
532 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
533 double>::__type
534 tanh(_Tp __x)
535 { return __builtin_tanh(__x); }
536
537 _GLIBCXX_END_NAMESPACE_VERSION
538 } // namespace
539
540 #if _GLIBCXX_USE_C99_MATH
541 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
542
543 // These are possible macros imported from C99-land.
544 #undef fpclassify
545 #undef isfinite
546 #undef isinf
547 #undef isnan
548 #undef isnormal
549 #undef signbit
550 #undef isgreater
551 #undef isgreaterequal
552 #undef isless
553 #undef islessequal
554 #undef islessgreater
555 #undef isunordered
556
557 namespace std _GLIBCXX_VISIBILITY(default)
558 {
559 _GLIBCXX_BEGIN_NAMESPACE_VERSION
560
561 #ifdef __GXX_EXPERIMENTAL_CXX0X__
562 constexpr int
563 fpclassify(float __x)
564 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
565 FP_SUBNORMAL, FP_ZERO, __x); }
566
567 constexpr int
568 fpclassify(double __x)
569 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
570 FP_SUBNORMAL, FP_ZERO, __x); }
571
572 constexpr int
573 fpclassify(long double __x)
574 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
575 FP_SUBNORMAL, FP_ZERO, __x); }
576
577 template<typename _Tp>
578 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
579 int>::__type
580 fpclassify(_Tp __x)
581 { return __x != 0 ? FP_NORMAL : FP_ZERO; }
582
583 constexpr bool
584 isfinite(float __x)
585 { return __builtin_isfinite(__x); }
586
587 constexpr bool
588 isfinite(double __x)
589 { return __builtin_isfinite(__x); }
590
591 constexpr bool
592 isfinite(long double __x)
593 { return __builtin_isfinite(__x); }
594
595 template<typename _Tp>
596 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
597 bool>::__type
598 isfinite(_Tp __x)
599 { return true; }
600
601 constexpr bool
602 isinf(float __x)
603 { return __builtin_isinf(__x); }
604
605 constexpr bool
606 isinf(double __x)
607 { return __builtin_isinf(__x); }
608
609 constexpr bool
610 isinf(long double __x)
611 { return __builtin_isinf(__x); }
612
613 template<typename _Tp>
614 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
615 bool>::__type
616 isinf(_Tp __x)
617 { return false; }
618
619 constexpr bool
620 isnan(float __x)
621 { return __builtin_isnan(__x); }
622
623 constexpr bool
624 isnan(double __x)
625 { return __builtin_isnan(__x); }
626
627 constexpr bool
628 isnan(long double __x)
629 { return __builtin_isnan(__x); }
630
631 template<typename _Tp>
632 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
633 bool>::__type
634 isnan(_Tp __x)
635 { return false; }
636
637 constexpr bool
638 isnormal(float __x)
639 { return __builtin_isnormal(__x); }
640
641 constexpr bool
642 isnormal(double __x)
643 { return __builtin_isnormal(__x); }
644
645 constexpr bool
646 isnormal(long double __x)
647 { return __builtin_isnormal(__x); }
648
649 template<typename _Tp>
650 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
651 bool>::__type
652 isnormal(_Tp __x)
653 { return __x != 0 ? true : false; }
654
655 constexpr bool
656 signbit(float __x)
657 { return __builtin_signbit(__x); }
658
659 constexpr bool
660 signbit(double __x)
661 { return __builtin_signbit(__x); }
662
663 constexpr bool
664 signbit(long double __x)
665 { return __builtin_signbit(__x); }
666
667 template<typename _Tp>
668 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
669 bool>::__type
670 signbit(_Tp __x)
671 { return __x < 0 ? true : false; }
672
673 constexpr bool
674 isgreater(float __x, float __y)
675 { return __builtin_isgreater(__x, __y); }
676
677 constexpr bool
678 isgreater(double __x, double __y)
679 { return __builtin_isgreater(__x, __y); }
680
681 constexpr bool
682 isgreater(long double __x, long double __y)
683 { return __builtin_isgreater(__x, __y); }
684
685 template<typename _Tp, typename _Up>
686 constexpr typename
687 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
688 && __is_arithmetic<_Up>::__value), bool>::__type
689 isgreater(_Tp __x, _Up __y)
690 {
691 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
692 return __builtin_isgreater(__type(__x), __type(__y));
693 }
694
695 constexpr bool
696 isgreaterequal(float __x, float __y)
697 { return __builtin_isgreaterequal(__x, __y); }
698
699 constexpr bool
700 isgreaterequal(double __x, double __y)
701 { return __builtin_isgreaterequal(__x, __y); }
702
703 constexpr bool
704 isgreaterequal(long double __x, long double __y)
705 { return __builtin_isgreaterequal(__x, __y); }
706
707 template<typename _Tp, typename _Up>
708 constexpr typename
709 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
710 && __is_arithmetic<_Up>::__value), bool>::__type
711 isgreaterequal(_Tp __x, _Up __y)
712 {
713 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
714 return __builtin_isgreaterequal(__type(__x), __type(__y));
715 }
716
717 constexpr bool
718 isless(float __x, float __y)
719 { return __builtin_isless(__x, __y); }
720
721 constexpr bool
722 isless(double __x, double __y)
723 { return __builtin_isless(__x, __y); }
724
725 constexpr bool
726 isless(long double __x, long double __y)
727 { return __builtin_isless(__x, __y); }
728
729 template<typename _Tp, typename _Up>
730 constexpr typename
731 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
732 && __is_arithmetic<_Up>::__value), bool>::__type
733 isless(_Tp __x, _Up __y)
734 {
735 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
736 return __builtin_isless(__type(__x), __type(__y));
737 }
738
739 constexpr bool
740 islessequal(float __x, float __y)
741 { return __builtin_islessequal(__x, __y); }
742
743 constexpr bool
744 islessequal(double __x, double __y)
745 { return __builtin_islessequal(__x, __y); }
746
747 constexpr bool
748 islessequal(long double __x, long double __y)
749 { return __builtin_islessequal(__x, __y); }
750
751 template<typename _Tp, typename _Up>
752 constexpr typename
753 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
754 && __is_arithmetic<_Up>::__value), bool>::__type
755 islessequal(_Tp __x, _Up __y)
756 {
757 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
758 return __builtin_islessequal(__type(__x), __type(__y));
759 }
760
761 constexpr bool
762 islessgreater(float __x, float __y)
763 { return __builtin_islessgreater(__x, __y); }
764
765 constexpr bool
766 islessgreater(double __x, double __y)
767 { return __builtin_islessgreater(__x, __y); }
768
769 constexpr bool
770 islessgreater(long double __x, long double __y)
771 { return __builtin_islessgreater(__x, __y); }
772
773 template<typename _Tp, typename _Up>
774 constexpr typename
775 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
776 && __is_arithmetic<_Up>::__value), bool>::__type
777 islessgreater(_Tp __x, _Up __y)
778 {
779 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
780 return __builtin_islessgreater(__type(__x), __type(__y));
781 }
782
783 constexpr bool
784 isunordered(float __x, float __y)
785 { return __builtin_isunordered(__x, __y); }
786
787 constexpr bool
788 isunordered(double __x, double __y)
789 { return __builtin_isunordered(__x, __y); }
790
791 constexpr bool
792 isunordered(long double __x, long double __y)
793 { return __builtin_isunordered(__x, __y); }
794
795 template<typename _Tp, typename _Up>
796 constexpr typename
797 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
798 && __is_arithmetic<_Up>::__value), bool>::__type
799 isunordered(_Tp __x, _Up __y)
800 {
801 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
802 return __builtin_isunordered(__type(__x), __type(__y));
803 }
804
805 #else
806
807 template<typename _Tp>
808 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
809 int>::__type
810 fpclassify(_Tp __f)
811 {
812 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
813 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
814 FP_SUBNORMAL, FP_ZERO, __type(__f));
815 }
816
817 template<typename _Tp>
818 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
819 int>::__type
820 isfinite(_Tp __f)
821 {
822 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
823 return __builtin_isfinite(__type(__f));
824 }
825
826 template<typename _Tp>
827 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
828 int>::__type
829 isinf(_Tp __f)
830 {
831 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
832 return __builtin_isinf(__type(__f));
833 }
834
835 template<typename _Tp>
836 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
837 int>::__type
838 isnan(_Tp __f)
839 {
840 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
841 return __builtin_isnan(__type(__f));
842 }
843
844 template<typename _Tp>
845 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
846 int>::__type
847 isnormal(_Tp __f)
848 {
849 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
850 return __builtin_isnormal(__type(__f));
851 }
852
853 template<typename _Tp>
854 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
855 int>::__type
856 signbit(_Tp __f)
857 {
858 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
859 return __builtin_signbit(__type(__f));
860 }
861
862 template<typename _Tp>
863 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
864 int>::__type
865 isgreater(_Tp __f1, _Tp __f2)
866 {
867 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
868 return __builtin_isgreater(__type(__f1), __type(__f2));
869 }
870
871 template<typename _Tp>
872 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
873 int>::__type
874 isgreaterequal(_Tp __f1, _Tp __f2)
875 {
876 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
877 return __builtin_isgreaterequal(__type(__f1), __type(__f2));
878 }
879
880 template<typename _Tp>
881 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
882 int>::__type
883 isless(_Tp __f1, _Tp __f2)
884 {
885 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
886 return __builtin_isless(__type(__f1), __type(__f2));
887 }
888
889 template<typename _Tp>
890 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
891 int>::__type
892 islessequal(_Tp __f1, _Tp __f2)
893 {
894 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
895 return __builtin_islessequal(__type(__f1), __type(__f2));
896 }
897
898 template<typename _Tp>
899 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
900 int>::__type
901 islessgreater(_Tp __f1, _Tp __f2)
902 {
903 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
904 return __builtin_islessgreater(__type(__f1), __type(__f2));
905 }
906
907 template<typename _Tp>
908 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
909 int>::__type
910 isunordered(_Tp __f1, _Tp __f2)
911 {
912 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
913 return __builtin_isunordered(__type(__f1), __type(__f2));
914 }
915
916 #endif
917
918 _GLIBCXX_END_NAMESPACE_VERSION
919 } // namespace
920
921 #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
922 #endif
923
924 #ifdef __GXX_EXPERIMENTAL_CXX0X__
925
926 #ifdef _GLIBCXX_USE_C99_MATH_TR1
927
928 #undef acosh
929 #undef acoshf
930 #undef acoshl
931 #undef asinh
932 #undef asinhf
933 #undef asinhl
934 #undef atanh
935 #undef atanhf
936 #undef atanhl
937 #undef cbrt
938 #undef cbrtf
939 #undef cbrtl
940 #undef copysign
941 #undef copysignf
942 #undef copysignl
943 #undef erf
944 #undef erff
945 #undef erfl
946 #undef erfc
947 #undef erfcf
948 #undef erfcl
949 #undef exp2
950 #undef exp2f
951 #undef exp2l
952 #undef expm1
953 #undef expm1f
954 #undef expm1l
955 #undef fdim
956 #undef fdimf
957 #undef fdiml
958 #undef fma
959 #undef fmaf
960 #undef fmal
961 #undef fmax
962 #undef fmaxf
963 #undef fmaxl
964 #undef fmin
965 #undef fminf
966 #undef fminl
967 #undef hypot
968 #undef hypotf
969 #undef hypotl
970 #undef ilogb
971 #undef ilogbf
972 #undef ilogbl
973 #undef lgamma
974 #undef lgammaf
975 #undef lgammal
976 #undef llrint
977 #undef llrintf
978 #undef llrintl
979 #undef llround
980 #undef llroundf
981 #undef llroundl
982 #undef log1p
983 #undef log1pf
984 #undef log1pl
985 #undef log2
986 #undef log2f
987 #undef log2l
988 #undef logb
989 #undef logbf
990 #undef logbl
991 #undef lrint
992 #undef lrintf
993 #undef lrintl
994 #undef lround
995 #undef lroundf
996 #undef lroundl
997 #undef nan
998 #undef nanf
999 #undef nanl
1000 #undef nearbyint
1001 #undef nearbyintf
1002 #undef nearbyintl
1003 #undef nextafter
1004 #undef nextafterf
1005 #undef nextafterl
1006 #undef nexttoward
1007 #undef nexttowardf
1008 #undef nexttowardl
1009 #undef remainder
1010 #undef remainderf
1011 #undef remainderl
1012 #undef remquo
1013 #undef remquof
1014 #undef remquol
1015 #undef rint
1016 #undef rintf
1017 #undef rintl
1018 #undef round
1019 #undef roundf
1020 #undef roundl
1021 #undef scalbln
1022 #undef scalblnf
1023 #undef scalblnl
1024 #undef scalbn
1025 #undef scalbnf
1026 #undef scalbnl
1027 #undef tgamma
1028 #undef tgammaf
1029 #undef tgammal
1030 #undef trunc
1031 #undef truncf
1032 #undef truncl
1033
1034 namespace std _GLIBCXX_VISIBILITY(default)
1035 {
1036 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1037
1038 // types
1039 using ::double_t;
1040 using ::float_t;
1041
1042 // functions
1043 using ::acosh;
1044 using ::acoshf;
1045 using ::acoshl;
1046
1047 using ::asinh;
1048 using ::asinhf;
1049 using ::asinhl;
1050
1051 using ::atanh;
1052 using ::atanhf;
1053 using ::atanhl;
1054
1055 using ::cbrt;
1056 using ::cbrtf;
1057 using ::cbrtl;
1058
1059 using ::copysign;
1060 using ::copysignf;
1061 using ::copysignl;
1062
1063 using ::erf;
1064 using ::erff;
1065 using ::erfl;
1066
1067 using ::erfc;
1068 using ::erfcf;
1069 using ::erfcl;
1070
1071 using ::exp2;
1072 using ::exp2f;
1073 using ::exp2l;
1074
1075 using ::expm1;
1076 using ::expm1f;
1077 using ::expm1l;
1078
1079 using ::fdim;
1080 using ::fdimf;
1081 using ::fdiml;
1082
1083 using ::fma;
1084 using ::fmaf;
1085 using ::fmal;
1086
1087 using ::fmax;
1088 using ::fmaxf;
1089 using ::fmaxl;
1090
1091 using ::fmin;
1092 using ::fminf;
1093 using ::fminl;
1094
1095 using ::hypot;
1096 using ::hypotf;
1097 using ::hypotl;
1098
1099 using ::ilogb;
1100 using ::ilogbf;
1101 using ::ilogbl;
1102
1103 using ::lgamma;
1104 using ::lgammaf;
1105 using ::lgammal;
1106
1107 using ::llrint;
1108 using ::llrintf;
1109 using ::llrintl;
1110
1111 using ::llround;
1112 using ::llroundf;
1113 using ::llroundl;
1114
1115 using ::log1p;
1116 using ::log1pf;
1117 using ::log1pl;
1118
1119 using ::log2;
1120 using ::log2f;
1121 using ::log2l;
1122
1123 using ::logb;
1124 using ::logbf;
1125 using ::logbl;
1126
1127 using ::lrint;
1128 using ::lrintf;
1129 using ::lrintl;
1130
1131 using ::lround;
1132 using ::lroundf;
1133 using ::lroundl;
1134
1135 using ::nan;
1136 using ::nanf;
1137 using ::nanl;
1138
1139 using ::nearbyint;
1140 using ::nearbyintf;
1141 using ::nearbyintl;
1142
1143 using ::nextafter;
1144 using ::nextafterf;
1145 using ::nextafterl;
1146
1147 using ::nexttoward;
1148 using ::nexttowardf;
1149 using ::nexttowardl;
1150
1151 using ::remainder;
1152 using ::remainderf;
1153 using ::remainderl;
1154
1155 using ::remquo;
1156 using ::remquof;
1157 using ::remquol;
1158
1159 using ::rint;
1160 using ::rintf;
1161 using ::rintl;
1162
1163 using ::round;
1164 using ::roundf;
1165 using ::roundl;
1166
1167 using ::scalbln;
1168 using ::scalblnf;
1169 using ::scalblnl;
1170
1171 using ::scalbn;
1172 using ::scalbnf;
1173 using ::scalbnl;
1174
1175 using ::tgamma;
1176 using ::tgammaf;
1177 using ::tgammal;
1178
1179 using ::trunc;
1180 using ::truncf;
1181 using ::truncl;
1182
1183 /// Additional overloads.
1184 constexpr float
1185 acosh(float __x)
1186 { return __builtin_acoshf(__x); }
1187
1188 constexpr long double
1189 acosh(long double __x)
1190 { return __builtin_acoshl(__x); }
1191
1192 template<typename _Tp>
1193 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1194 double>::__type
1195 acosh(_Tp __x)
1196 { return __builtin_acosh(__x); }
1197
1198 constexpr float
1199 asinh(float __x)
1200 { return __builtin_asinhf(__x); }
1201
1202 constexpr long double
1203 asinh(long double __x)
1204 { return __builtin_asinhl(__x); }
1205
1206 template<typename _Tp>
1207 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1208 double>::__type
1209 asinh(_Tp __x)
1210 { return __builtin_asinh(__x); }
1211
1212 constexpr float
1213 atanh(float __x)
1214 { return __builtin_atanhf(__x); }
1215
1216 constexpr long double
1217 atanh(long double __x)
1218 { return __builtin_atanhl(__x); }
1219
1220 template<typename _Tp>
1221 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1222 double>::__type
1223 atanh(_Tp __x)
1224 { return __builtin_atanh(__x); }
1225
1226 constexpr float
1227 cbrt(float __x)
1228 { return __builtin_cbrtf(__x); }
1229
1230 constexpr long double
1231 cbrt(long double __x)
1232 { return __builtin_cbrtl(__x); }
1233
1234 template<typename _Tp>
1235 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1236 double>::__type
1237 cbrt(_Tp __x)
1238 { return __builtin_cbrt(__x); }
1239
1240 constexpr float
1241 copysign(float __x, float __y)
1242 { return __builtin_copysignf(__x, __y); }
1243
1244 constexpr long double
1245 copysign(long double __x, long double __y)
1246 { return __builtin_copysignl(__x, __y); }
1247
1248 template<typename _Tp, typename _Up>
1249 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1250 copysign(_Tp __x, _Up __y)
1251 {
1252 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1253 return copysign(__type(__x), __type(__y));
1254 }
1255
1256 constexpr float
1257 erf(float __x)
1258 { return __builtin_erff(__x); }
1259
1260 constexpr long double
1261 erf(long double __x)
1262 { return __builtin_erfl(__x); }
1263
1264 template<typename _Tp>
1265 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1266 double>::__type
1267 erf(_Tp __x)
1268 { return __builtin_erf(__x); }
1269
1270 constexpr float
1271 erfc(float __x)
1272 { return __builtin_erfcf(__x); }
1273
1274 constexpr long double
1275 erfc(long double __x)
1276 { return __builtin_erfcl(__x); }
1277
1278 template<typename _Tp>
1279 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1280 double>::__type
1281 erfc(_Tp __x)
1282 { return __builtin_erfc(__x); }
1283
1284 constexpr float
1285 exp2(float __x)
1286 { return __builtin_exp2f(__x); }
1287
1288 constexpr long double
1289 exp2(long double __x)
1290 { return __builtin_exp2l(__x); }
1291
1292 template<typename _Tp>
1293 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1294 double>::__type
1295 exp2(_Tp __x)
1296 { return __builtin_exp2(__x); }
1297
1298 constexpr float
1299 expm1(float __x)
1300 { return __builtin_expm1f(__x); }
1301
1302 constexpr long double
1303 expm1(long double __x)
1304 { return __builtin_expm1l(__x); }
1305
1306 template<typename _Tp>
1307 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1308 double>::__type
1309 expm1(_Tp __x)
1310 { return __builtin_expm1(__x); }
1311
1312 constexpr float
1313 fdim(float __x, float __y)
1314 { return __builtin_fdimf(__x, __y); }
1315
1316 constexpr long double
1317 fdim(long double __x, long double __y)
1318 { return __builtin_fdiml(__x, __y); }
1319
1320 template<typename _Tp, typename _Up>
1321 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1322 fdim(_Tp __x, _Up __y)
1323 {
1324 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1325 return fdim(__type(__x), __type(__y));
1326 }
1327
1328 constexpr float
1329 fma(float __x, float __y, float __z)
1330 { return __builtin_fmaf(__x, __y, __z); }
1331
1332 constexpr long double
1333 fma(long double __x, long double __y, long double __z)
1334 { return __builtin_fmal(__x, __y, __z); }
1335
1336 template<typename _Tp, typename _Up, typename _Vp>
1337 constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
1338 fma(_Tp __x, _Up __y, _Vp __z)
1339 {
1340 typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
1341 return fma(__type(__x), __type(__y), __type(__z));
1342 }
1343
1344 constexpr float
1345 fmax(float __x, float __y)
1346 { return __builtin_fmaxf(__x, __y); }
1347
1348 constexpr long double
1349 fmax(long double __x, long double __y)
1350 { return __builtin_fmaxl(__x, __y); }
1351
1352 template<typename _Tp, typename _Up>
1353 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1354 fmax(_Tp __x, _Up __y)
1355 {
1356 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1357 return fmax(__type(__x), __type(__y));
1358 }
1359
1360 constexpr float
1361 fmin(float __x, float __y)
1362 { return __builtin_fminf(__x, __y); }
1363
1364 constexpr long double
1365 fmin(long double __x, long double __y)
1366 { return __builtin_fminl(__x, __y); }
1367
1368 template<typename _Tp, typename _Up>
1369 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1370 fmin(_Tp __x, _Up __y)
1371 {
1372 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1373 return fmin(__type(__x), __type(__y));
1374 }
1375
1376 constexpr float
1377 hypot(float __x, float __y)
1378 { return __builtin_hypotf(__x, __y); }
1379
1380 constexpr long double
1381 hypot(long double __x, long double __y)
1382 { return __builtin_hypotl(__x, __y); }
1383
1384 template<typename _Tp, typename _Up>
1385 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1386 hypot(_Tp __x, _Up __y)
1387 {
1388 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1389 return hypot(__type(__x), __type(__y));
1390 }
1391
1392 constexpr int
1393 ilogb(float __x)
1394 { return __builtin_ilogbf(__x); }
1395
1396 constexpr int
1397 ilogb(long double __x)
1398 { return __builtin_ilogbl(__x); }
1399
1400 template<typename _Tp>
1401 constexpr
1402 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1403 int>::__type
1404 ilogb(_Tp __x)
1405 { return __builtin_ilogb(__x); }
1406
1407 constexpr float
1408 lgamma(float __x)
1409 { return __builtin_lgammaf(__x); }
1410
1411 constexpr long double
1412 lgamma(long double __x)
1413 { return __builtin_lgammal(__x); }
1414
1415 template<typename _Tp>
1416 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1417 double>::__type
1418 lgamma(_Tp __x)
1419 { return __builtin_lgamma(__x); }
1420
1421 constexpr long long
1422 llrint(float __x)
1423 { return __builtin_llrintf(__x); }
1424
1425 constexpr long long
1426 llrint(long double __x)
1427 { return __builtin_llrintl(__x); }
1428
1429 template<typename _Tp>
1430 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1431 long long>::__type
1432 llrint(_Tp __x)
1433 { return __builtin_llrint(__x); }
1434
1435 constexpr long long
1436 llround(float __x)
1437 { return __builtin_llroundf(__x); }
1438
1439 constexpr long long
1440 llround(long double __x)
1441 { return __builtin_llroundl(__x); }
1442
1443 template<typename _Tp>
1444 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1445 long long>::__type
1446 llround(_Tp __x)
1447 { return __builtin_llround(__x); }
1448
1449 constexpr float
1450 log1p(float __x)
1451 { return __builtin_log1pf(__x); }
1452
1453 constexpr long double
1454 log1p(long double __x)
1455 { return __builtin_log1pl(__x); }
1456
1457 template<typename _Tp>
1458 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1459 double>::__type
1460 log1p(_Tp __x)
1461 { return __builtin_log1p(__x); }
1462
1463 // DR 568.
1464 constexpr float
1465 log2(float __x)
1466 { return __builtin_log2f(__x); }
1467
1468 constexpr long double
1469 log2(long double __x)
1470 { return __builtin_log2l(__x); }
1471
1472 template<typename _Tp>
1473 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1474 double>::__type
1475 log2(_Tp __x)
1476 { return __builtin_log2(__x); }
1477
1478 constexpr float
1479 logb(float __x)
1480 { return __builtin_logbf(__x); }
1481
1482 constexpr long double
1483 logb(long double __x)
1484 { return __builtin_logbl(__x); }
1485
1486 template<typename _Tp>
1487 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1488 double>::__type
1489 logb(_Tp __x)
1490 { return __builtin_logb(__x); }
1491
1492 constexpr long
1493 lrint(float __x)
1494 { return __builtin_lrintf(__x); }
1495
1496 constexpr long
1497 lrint(long double __x)
1498 { return __builtin_lrintl(__x); }
1499
1500 template<typename _Tp>
1501 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1502 long>::__type
1503 lrint(_Tp __x)
1504 { return __builtin_lrint(__x); }
1505
1506 constexpr long
1507 lround(float __x)
1508 { return __builtin_lroundf(__x); }
1509
1510 constexpr long
1511 lround(long double __x)
1512 { return __builtin_lroundl(__x); }
1513
1514 template<typename _Tp>
1515 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1516 long>::__type
1517 lround(_Tp __x)
1518 { return __builtin_lround(__x); }
1519
1520 constexpr float
1521 nearbyint(float __x)
1522 { return __builtin_nearbyintf(__x); }
1523
1524 constexpr long double
1525 nearbyint(long double __x)
1526 { return __builtin_nearbyintl(__x); }
1527
1528 template<typename _Tp>
1529 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1530 double>::__type
1531 nearbyint(_Tp __x)
1532 { return __builtin_nearbyint(__x); }
1533
1534 constexpr float
1535 nextafter(float __x, float __y)
1536 { return __builtin_nextafterf(__x, __y); }
1537
1538 constexpr long double
1539 nextafter(long double __x, long double __y)
1540 { return __builtin_nextafterl(__x, __y); }
1541
1542 template<typename _Tp, typename _Up>
1543 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1544 nextafter(_Tp __x, _Up __y)
1545 {
1546 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1547 return nextafter(__type(__x), __type(__y));
1548 }
1549
1550 constexpr float
1551 nexttoward(float __x, long double __y)
1552 { return __builtin_nexttowardf(__x, __y); }
1553
1554 constexpr long double
1555 nexttoward(long double __x, long double __y)
1556 { return __builtin_nexttowardl(__x, __y); }
1557
1558 template<typename _Tp>
1559 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1560 double>::__type
1561 nexttoward(_Tp __x, long double __y)
1562 { return __builtin_nexttoward(__x, __y); }
1563
1564 constexpr float
1565 remainder(float __x, float __y)
1566 { return __builtin_remainderf(__x, __y); }
1567
1568 constexpr long double
1569 remainder(long double __x, long double __y)
1570 { return __builtin_remainderl(__x, __y); }
1571
1572 template<typename _Tp, typename _Up>
1573 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1574 remainder(_Tp __x, _Up __y)
1575 {
1576 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1577 return remainder(__type(__x), __type(__y));
1578 }
1579
1580 inline float
1581 remquo(float __x, float __y, int* __pquo)
1582 { return __builtin_remquof(__x, __y, __pquo); }
1583
1584 inline long double
1585 remquo(long double __x, long double __y, int* __pquo)
1586 { return __builtin_remquol(__x, __y, __pquo); }
1587
1588 template<typename _Tp, typename _Up>
1589 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1590 remquo(_Tp __x, _Up __y, int* __pquo)
1591 {
1592 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1593 return remquo(__type(__x), __type(__y), __pquo);
1594 }
1595
1596 constexpr float
1597 rint(float __x)
1598 { return __builtin_rintf(__x); }
1599
1600 constexpr long double
1601 rint(long double __x)
1602 { return __builtin_rintl(__x); }
1603
1604 template<typename _Tp>
1605 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1606 double>::__type
1607 rint(_Tp __x)
1608 { return __builtin_rint(__x); }
1609
1610 constexpr float
1611 round(float __x)
1612 { return __builtin_roundf(__x); }
1613
1614 constexpr long double
1615 round(long double __x)
1616 { return __builtin_roundl(__x); }
1617
1618 template<typename _Tp>
1619 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1620 double>::__type
1621 round(_Tp __x)
1622 { return __builtin_round(__x); }
1623
1624 constexpr float
1625 scalbln(float __x, long __ex)
1626 { return __builtin_scalblnf(__x, __ex); }
1627
1628 constexpr long double
1629 scalbln(long double __x, long __ex)
1630 { return __builtin_scalblnl(__x, __ex); }
1631
1632 template<typename _Tp>
1633 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1634 double>::__type
1635 scalbln(_Tp __x, long __ex)
1636 { return __builtin_scalbln(__x, __ex); }
1637
1638 constexpr float
1639 scalbn(float __x, int __ex)
1640 { return __builtin_scalbnf(__x, __ex); }
1641
1642 constexpr long double
1643 scalbn(long double __x, int __ex)
1644 { return __builtin_scalbnl(__x, __ex); }
1645
1646 template<typename _Tp>
1647 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1648 double>::__type
1649 scalbn(_Tp __x, int __ex)
1650 { return __builtin_scalbn(__x, __ex); }
1651
1652 constexpr float
1653 tgamma(float __x)
1654 { return __builtin_tgammaf(__x); }
1655
1656 constexpr long double
1657 tgamma(long double __x)
1658 { return __builtin_tgammal(__x); }
1659
1660 template<typename _Tp>
1661 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1662 double>::__type
1663 tgamma(_Tp __x)
1664 { return __builtin_tgamma(__x); }
1665
1666 constexpr float
1667 trunc(float __x)
1668 { return __builtin_truncf(__x); }
1669
1670 constexpr long double
1671 trunc(long double __x)
1672 { return __builtin_truncl(__x); }
1673
1674 template<typename _Tp>
1675 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1676 double>::__type
1677 trunc(_Tp __x)
1678 { return __builtin_trunc(__x); }
1679
1680 _GLIBCXX_END_NAMESPACE_VERSION
1681 } // namespace
1682
1683 #endif // _GLIBCXX_USE_C99_MATH_TR1
1684
1685 #endif // __GXX_EXPERIMENTAL_CXX0X__
1686
1687 #endif