]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/c_global/cmath
cmath (__pow_helper): Remove.
[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
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 _GLIBCXX_BEGIN_NAMESPACE(std)
78
79 inline double
80 abs(double __x)
81 { return __builtin_fabs(__x); }
82
83 inline float
84 abs(float __x)
85 { return __builtin_fabsf(__x); }
86
87 inline long double
88 abs(long double __x)
89 { return __builtin_fabsl(__x); }
90
91 template<typename _Tp>
92 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
93 double>::__type
94 abs(_Tp __x)
95 { return __builtin_fabs(__x); }
96
97 using ::acos;
98
99 inline float
100 acos(float __x)
101 { return __builtin_acosf(__x); }
102
103 inline long double
104 acos(long double __x)
105 { return __builtin_acosl(__x); }
106
107 template<typename _Tp>
108 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
109 double>::__type
110 acos(_Tp __x)
111 { return __builtin_acos(__x); }
112
113 using ::asin;
114
115 inline float
116 asin(float __x)
117 { return __builtin_asinf(__x); }
118
119 inline long double
120 asin(long double __x)
121 { return __builtin_asinl(__x); }
122
123 template<typename _Tp>
124 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
125 double>::__type
126 asin(_Tp __x)
127 { return __builtin_asin(__x); }
128
129 using ::atan;
130
131 inline float
132 atan(float __x)
133 { return __builtin_atanf(__x); }
134
135 inline long double
136 atan(long double __x)
137 { return __builtin_atanl(__x); }
138
139 template<typename _Tp>
140 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
141 double>::__type
142 atan(_Tp __x)
143 { return __builtin_atan(__x); }
144
145 using ::atan2;
146
147 inline float
148 atan2(float __y, float __x)
149 { return __builtin_atan2f(__y, __x); }
150
151 inline long double
152 atan2(long double __y, long double __x)
153 { return __builtin_atan2l(__y, __x); }
154
155 template<typename _Tp, typename _Up>
156 inline
157 typename __gnu_cxx::__promote_2<
158 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
159 && __is_arithmetic<_Up>::__value,
160 _Tp>::__type, _Up>::__type
161 atan2(_Tp __y, _Up __x)
162 {
163 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
164 return atan2(__type(__y), __type(__x));
165 }
166
167 using ::ceil;
168
169 inline float
170 ceil(float __x)
171 { return __builtin_ceilf(__x); }
172
173 inline long double
174 ceil(long double __x)
175 { return __builtin_ceill(__x); }
176
177 template<typename _Tp>
178 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
179 double>::__type
180 ceil(_Tp __x)
181 { return __builtin_ceil(__x); }
182
183 using ::cos;
184
185 inline float
186 cos(float __x)
187 { return __builtin_cosf(__x); }
188
189 inline long double
190 cos(long double __x)
191 { return __builtin_cosl(__x); }
192
193 template<typename _Tp>
194 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
195 double>::__type
196 cos(_Tp __x)
197 { return __builtin_cos(__x); }
198
199 using ::cosh;
200
201 inline float
202 cosh(float __x)
203 { return __builtin_coshf(__x); }
204
205 inline long double
206 cosh(long double __x)
207 { return __builtin_coshl(__x); }
208
209 template<typename _Tp>
210 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
211 double>::__type
212 cosh(_Tp __x)
213 { return __builtin_cosh(__x); }
214
215 using ::exp;
216
217 inline float
218 exp(float __x)
219 { return __builtin_expf(__x); }
220
221 inline long double
222 exp(long double __x)
223 { return __builtin_expl(__x); }
224
225 template<typename _Tp>
226 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
227 double>::__type
228 exp(_Tp __x)
229 { return __builtin_exp(__x); }
230
231 using ::fabs;
232
233 inline float
234 fabs(float __x)
235 { return __builtin_fabsf(__x); }
236
237 inline long double
238 fabs(long double __x)
239 { return __builtin_fabsl(__x); }
240
241 template<typename _Tp>
242 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
243 double>::__type
244 fabs(_Tp __x)
245 { return __builtin_fabs(__x); }
246
247 using ::floor;
248
249 inline float
250 floor(float __x)
251 { return __builtin_floorf(__x); }
252
253 inline long double
254 floor(long double __x)
255 { return __builtin_floorl(__x); }
256
257 template<typename _Tp>
258 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
259 double>::__type
260 floor(_Tp __x)
261 { return __builtin_floor(__x); }
262
263 using ::fmod;
264
265 inline float
266 fmod(float __x, float __y)
267 { return __builtin_fmodf(__x, __y); }
268
269 inline long double
270 fmod(long double __x, long double __y)
271 { return __builtin_fmodl(__x, __y); }
272
273 using ::frexp;
274
275 inline float
276 frexp(float __x, int* __exp)
277 { return __builtin_frexpf(__x, __exp); }
278
279 inline long double
280 frexp(long double __x, int* __exp)
281 { return __builtin_frexpl(__x, __exp); }
282
283 template<typename _Tp>
284 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
285 double>::__type
286 frexp(_Tp __x, int* __exp)
287 { return __builtin_frexp(__x, __exp); }
288
289 using ::ldexp;
290
291 inline float
292 ldexp(float __x, int __exp)
293 { return __builtin_ldexpf(__x, __exp); }
294
295 inline long double
296 ldexp(long double __x, int __exp)
297 { return __builtin_ldexpl(__x, __exp); }
298
299 template<typename _Tp>
300 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
301 double>::__type
302 ldexp(_Tp __x, int __exp)
303 { return __builtin_ldexp(__x, __exp); }
304
305 using ::log;
306
307 inline float
308 log(float __x)
309 { return __builtin_logf(__x); }
310
311 inline long double
312 log(long double __x)
313 { return __builtin_logl(__x); }
314
315 template<typename _Tp>
316 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
317 double>::__type
318 log(_Tp __x)
319 { return __builtin_log(__x); }
320
321 using ::log10;
322
323 inline float
324 log10(float __x)
325 { return __builtin_log10f(__x); }
326
327 inline long double
328 log10(long double __x)
329 { return __builtin_log10l(__x); }
330
331 template<typename _Tp>
332 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
333 double>::__type
334 log10(_Tp __x)
335 { return __builtin_log10(__x); }
336
337 using ::modf;
338
339 inline float
340 modf(float __x, float* __iptr)
341 { return __builtin_modff(__x, __iptr); }
342
343 inline long double
344 modf(long double __x, long double* __iptr)
345 { return __builtin_modfl(__x, __iptr); }
346
347 using ::pow;
348
349 inline float
350 pow(float __x, float __y)
351 { return __builtin_powf(__x, __y); }
352
353 inline long double
354 pow(long double __x, long double __y)
355 { return __builtin_powl(__x, __y); }
356
357 #ifndef __GXX_EXPERIMENTAL_CXX0X__
358 // _GLIBCXX_RESOLVE_LIB_DEFECTS
359 // DR 550. What should the return type of pow(float,int) be?
360 inline double
361 pow(double __x, int __i)
362 { return __builtin_powi(__x, __i); }
363
364 inline float
365 pow(float __x, int __n)
366 { return __builtin_powif(__x, __n); }
367
368 inline long double
369 pow(long double __x, int __n)
370 { return __builtin_powil(__x, __n); }
371 #endif
372
373 template<typename _Tp, typename _Up>
374 inline
375 typename __gnu_cxx::__promote_2<
376 typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
377 && __is_arithmetic<_Up>::__value,
378 _Tp>::__type, _Up>::__type
379 pow(_Tp __x, _Up __y)
380 {
381 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
382 return pow(__type(__x), __type(__y));
383 }
384
385 using ::sin;
386
387 inline float
388 sin(float __x)
389 { return __builtin_sinf(__x); }
390
391 inline long double
392 sin(long double __x)
393 { return __builtin_sinl(__x); }
394
395 template<typename _Tp>
396 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
397 double>::__type
398 sin(_Tp __x)
399 { return __builtin_sin(__x); }
400
401 using ::sinh;
402
403 inline float
404 sinh(float __x)
405 { return __builtin_sinhf(__x); }
406
407 inline long double
408 sinh(long double __x)
409 { return __builtin_sinhl(__x); }
410
411 template<typename _Tp>
412 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
413 double>::__type
414 sinh(_Tp __x)
415 { return __builtin_sinh(__x); }
416
417 using ::sqrt;
418
419 inline float
420 sqrt(float __x)
421 { return __builtin_sqrtf(__x); }
422
423 inline long double
424 sqrt(long double __x)
425 { return __builtin_sqrtl(__x); }
426
427 template<typename _Tp>
428 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
429 double>::__type
430 sqrt(_Tp __x)
431 { return __builtin_sqrt(__x); }
432
433 using ::tan;
434
435 inline float
436 tan(float __x)
437 { return __builtin_tanf(__x); }
438
439 inline long double
440 tan(long double __x)
441 { return __builtin_tanl(__x); }
442
443 template<typename _Tp>
444 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
445 double>::__type
446 tan(_Tp __x)
447 { return __builtin_tan(__x); }
448
449 using ::tanh;
450
451 inline float
452 tanh(float __x)
453 { return __builtin_tanhf(__x); }
454
455 inline long double
456 tanh(long double __x)
457 { return __builtin_tanhl(__x); }
458
459 template<typename _Tp>
460 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
461 double>::__type
462 tanh(_Tp __x)
463 { return __builtin_tanh(__x); }
464
465 _GLIBCXX_END_NAMESPACE
466
467 #if _GLIBCXX_USE_C99_MATH
468 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
469
470 // These are possible macros imported from C99-land.
471 #undef fpclassify
472 #undef isfinite
473 #undef isinf
474 #undef isnan
475 #undef isnormal
476 #undef signbit
477 #undef isgreater
478 #undef isgreaterequal
479 #undef isless
480 #undef islessequal
481 #undef islessgreater
482 #undef isunordered
483
484 _GLIBCXX_BEGIN_NAMESPACE(std)
485
486 #ifdef __GXX_EXPERIMENTAL_CXX0X__
487 inline int
488 fpclassify(float __x)
489 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
490 FP_SUBNORMAL, FP_ZERO, __x); }
491
492 inline int
493 fpclassify(double __x)
494 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
495 FP_SUBNORMAL, FP_ZERO, __x); }
496
497 inline int
498 fpclassify(long double __x)
499 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
500 FP_SUBNORMAL, FP_ZERO, __x); }
501
502 template<typename _Tp>
503 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
504 int>::__type
505 fpclassify(_Tp __x)
506 { return __x != 0 ? FP_NORMAL : FP_ZERO; }
507
508 inline bool
509 isfinite(float __x)
510 { return __builtin_isfinite(__x); }
511
512 inline bool
513 isfinite(double __x)
514 { return __builtin_isfinite(__x); }
515
516 inline bool
517 isfinite(long double __x)
518 { return __builtin_isfinite(__x); }
519
520 template<typename _Tp>
521 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
522 bool>::__type
523 isfinite(_Tp __x)
524 { return true; }
525
526 inline bool
527 isinf(float __x)
528 { return __builtin_isinf(__x); }
529
530 inline bool
531 isinf(double __x)
532 { return __builtin_isinf(__x); }
533
534 inline bool
535 isinf(long double __x)
536 { return __builtin_isinf(__x); }
537
538 template<typename _Tp>
539 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
540 bool>::__type
541 isinf(_Tp __x)
542 { return false; }
543
544 inline bool
545 isnan(float __x)
546 { return __builtin_isnan(__x); }
547
548 inline bool
549 isnan(double __x)
550 { return __builtin_isnan(__x); }
551
552 inline bool
553 isnan(long double __x)
554 { return __builtin_isnan(__x); }
555
556 template<typename _Tp>
557 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
558 bool>::__type
559 isnan(_Tp __x)
560 { return false; }
561
562 inline bool
563 isnormal(float __x)
564 { return __builtin_isnormal(__x); }
565
566 inline bool
567 isnormal(double __x)
568 { return __builtin_isnormal(__x); }
569
570 inline bool
571 isnormal(long double __x)
572 { return __builtin_isnormal(__x); }
573
574 template<typename _Tp>
575 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
576 bool>::__type
577 isnormal(_Tp __x)
578 { return __x != 0 ? true : false; }
579
580 inline bool
581 signbit(float __x)
582 { return __builtin_signbit(__x); }
583
584 inline bool
585 signbit(double __x)
586 { return __builtin_signbit(__x); }
587
588 inline bool
589 signbit(long double __x)
590 { return __builtin_signbit(__x); }
591
592 template<typename _Tp>
593 inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
594 bool>::__type
595 signbit(_Tp __x)
596 { return __x < 0 ? true : false; }
597
598 inline bool
599 isgreater(float __x, float __y)
600 { return __builtin_isgreater(__x, __y); }
601
602 inline bool
603 isgreater(double __x, double __y)
604 { return __builtin_isgreater(__x, __y); }
605
606 inline bool
607 isgreater(long double __x, long double __y)
608 { return __builtin_isgreater(__x, __y); }
609
610 template<typename _Tp, typename _Up>
611 inline typename
612 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
613 && __is_arithmetic<_Up>::__value), bool>::__type
614 isgreater(_Tp __x, _Up __y)
615 {
616 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
617 return __builtin_isgreater(__type(__x), __type(__y));
618 }
619
620 inline bool
621 isgreaterequal(float __x, float __y)
622 { return __builtin_isgreaterequal(__x, __y); }
623
624 inline bool
625 isgreaterequal(double __x, double __y)
626 { return __builtin_isgreaterequal(__x, __y); }
627
628 inline bool
629 isgreaterequal(long double __x, long double __y)
630 { return __builtin_isgreaterequal(__x, __y); }
631
632 template<typename _Tp, typename _Up>
633 inline typename
634 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
635 && __is_arithmetic<_Up>::__value), bool>::__type
636 isgreaterequal(_Tp __x, _Up __y)
637 {
638 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
639 return __builtin_isgreaterequal(__type(__x), __type(__y));
640 }
641
642 inline bool
643 isless(float __x, float __y)
644 { return __builtin_isless(__x, __y); }
645
646 inline bool
647 isless(double __x, double __y)
648 { return __builtin_isless(__x, __y); }
649
650 inline bool
651 isless(long double __x, long double __y)
652 { return __builtin_isless(__x, __y); }
653
654 template<typename _Tp, typename _Up>
655 inline typename
656 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
657 && __is_arithmetic<_Up>::__value), bool>::__type
658 isless(_Tp __x, _Up __y)
659 {
660 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
661 return __builtin_isless(__type(__x), __type(__y));
662 }
663
664 inline bool
665 islessequal(float __x, float __y)
666 { return __builtin_islessequal(__x, __y); }
667
668 inline bool
669 islessequal(double __x, double __y)
670 { return __builtin_islessequal(__x, __y); }
671
672 inline bool
673 islessequal(long double __x, long double __y)
674 { return __builtin_islessequal(__x, __y); }
675
676 template<typename _Tp, typename _Up>
677 inline typename
678 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
679 && __is_arithmetic<_Up>::__value), bool>::__type
680 islessequal(_Tp __x, _Up __y)
681 {
682 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
683 return __builtin_islessequal(__type(__x), __type(__y));
684 }
685
686 inline bool
687 islessgreater(float __x, float __y)
688 { return __builtin_islessgreater(__x, __y); }
689
690 inline bool
691 islessgreater(double __x, double __y)
692 { return __builtin_islessgreater(__x, __y); }
693
694 inline bool
695 islessgreater(long double __x, long double __y)
696 { return __builtin_islessgreater(__x, __y); }
697
698 template<typename _Tp, typename _Up>
699 inline typename
700 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
701 && __is_arithmetic<_Up>::__value), bool>::__type
702 islessgreater(_Tp __x, _Up __y)
703 {
704 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
705 return __builtin_islessgreater(__type(__x), __type(__y));
706 }
707
708 inline bool
709 isunordered(float __x, float __y)
710 { return __builtin_isunordered(__x, __y); }
711
712 inline bool
713 isunordered(double __x, double __y)
714 { return __builtin_isunordered(__x, __y); }
715
716 inline bool
717 isunordered(long double __x, long double __y)
718 { return __builtin_isunordered(__x, __y); }
719
720 template<typename _Tp, typename _Up>
721 inline typename
722 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
723 && __is_arithmetic<_Up>::__value), bool>::__type
724 isunordered(_Tp __x, _Up __y)
725 {
726 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
727 return __builtin_isunordered(__type(__x), __type(__y));
728 }
729
730 #else
731
732 template<typename _Tp>
733 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
734 int>::__type
735 fpclassify(_Tp __f)
736 {
737 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
738 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
739 FP_SUBNORMAL, FP_ZERO, __type(__f));
740 }
741
742 template<typename _Tp>
743 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
744 int>::__type
745 isfinite(_Tp __f)
746 {
747 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
748 return __builtin_isfinite(__type(__f));
749 }
750
751 template<typename _Tp>
752 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
753 int>::__type
754 isinf(_Tp __f)
755 {
756 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
757 return __builtin_isinf(__type(__f));
758 }
759
760 template<typename _Tp>
761 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
762 int>::__type
763 isnan(_Tp __f)
764 {
765 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
766 return __builtin_isnan(__type(__f));
767 }
768
769 template<typename _Tp>
770 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
771 int>::__type
772 isnormal(_Tp __f)
773 {
774 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
775 return __builtin_isnormal(__type(__f));
776 }
777
778 template<typename _Tp>
779 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
780 int>::__type
781 signbit(_Tp __f)
782 {
783 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
784 return __builtin_signbit(__type(__f));
785 }
786
787 template<typename _Tp>
788 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
789 int>::__type
790 isgreater(_Tp __f1, _Tp __f2)
791 {
792 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
793 return __builtin_isgreater(__type(__f1), __type(__f2));
794 }
795
796 template<typename _Tp>
797 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
798 int>::__type
799 isgreaterequal(_Tp __f1, _Tp __f2)
800 {
801 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
802 return __builtin_isgreaterequal(__type(__f1), __type(__f2));
803 }
804
805 template<typename _Tp>
806 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
807 int>::__type
808 isless(_Tp __f1, _Tp __f2)
809 {
810 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
811 return __builtin_isless(__type(__f1), __type(__f2));
812 }
813
814 template<typename _Tp>
815 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
816 int>::__type
817 islessequal(_Tp __f1, _Tp __f2)
818 {
819 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
820 return __builtin_islessequal(__type(__f1), __type(__f2));
821 }
822
823 template<typename _Tp>
824 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
825 int>::__type
826 islessgreater(_Tp __f1, _Tp __f2)
827 {
828 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
829 return __builtin_islessgreater(__type(__f1), __type(__f2));
830 }
831
832 template<typename _Tp>
833 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
834 int>::__type
835 isunordered(_Tp __f1, _Tp __f2)
836 {
837 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
838 return __builtin_isunordered(__type(__f1), __type(__f2));
839 }
840
841 #endif
842
843 _GLIBCXX_END_NAMESPACE
844
845 #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
846 #endif
847
848 #ifdef __GXX_EXPERIMENTAL_CXX0X__
849 # if defined(_GLIBCXX_INCLUDE_AS_TR1)
850 # error C++0x header cannot be included from TR1 header
851 # endif
852 # if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
853 # include <tr1_impl/cmath>
854 # else
855 # define _GLIBCXX_INCLUDE_AS_CXX0X
856 # define _GLIBCXX_BEGIN_NAMESPACE_TR1
857 # define _GLIBCXX_END_NAMESPACE_TR1
858 # define _GLIBCXX_TR1
859 # include <tr1_impl/cmath>
860 # undef _GLIBCXX_TR1
861 # undef _GLIBCXX_END_NAMESPACE_TR1
862 # undef _GLIBCXX_BEGIN_NAMESPACE_TR1
863 # undef _GLIBCXX_INCLUDE_AS_CXX0X
864 # endif
865 #endif
866
867 #endif