1 // -*- C++ -*- C forwarding header.
3 // Copyright (C) 1997-2017 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
25 /** @file include/cmath
26 * This is a Standard C++ Library file. You should @c \#include this file
27 * in your programs, rather than any of the @a *.h implementation files.
29 * This is the C++ version of the Standard C Library header @c math.h,
30 * and its contents are (mostly) the same as that header, but are all
31 * contained in the namespace @c std (except for names which are defined
36 // ISO C++ 14882: 26.5 C library
39 #pragma GCC system_header
41 #include <bits/c++config.h>
42 #include <bits/cpp_type_traits.h>
43 #include <ext/type_traits.h>
44 #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
45 #include_next <math.h>
46 #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
47 #include <bits/std_abs.h>
49 #ifndef _GLIBCXX_CMATH
50 #define _GLIBCXX_CMATH 1
52 // Get rid of those macros defined in <math.h> in lieu of real functions.
79 namespace std _GLIBCXX_VISIBILITY(default)
81 _GLIBCXX_BEGIN_NAMESPACE_VERSION
85 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
86 inline _GLIBCXX_CONSTEXPR float
88 { return __builtin_acosf(__x); }
90 inline _GLIBCXX_CONSTEXPR long double
92 { return __builtin_acosl(__x); }
95 template<typename _Tp>
96 inline _GLIBCXX_CONSTEXPR
97 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
100 { return __builtin_acos(__x); }
104 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
105 inline _GLIBCXX_CONSTEXPR float
107 { return __builtin_asinf(__x); }
109 inline _GLIBCXX_CONSTEXPR long double
110 asin(long double __x)
111 { return __builtin_asinl(__x); }
114 template<typename _Tp>
115 inline _GLIBCXX_CONSTEXPR
116 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
119 { return __builtin_asin(__x); }
123 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
124 inline _GLIBCXX_CONSTEXPR float
126 { return __builtin_atanf(__x); }
128 inline _GLIBCXX_CONSTEXPR long double
129 atan(long double __x)
130 { return __builtin_atanl(__x); }
133 template<typename _Tp>
134 inline _GLIBCXX_CONSTEXPR
135 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
138 { return __builtin_atan(__x); }
142 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
143 inline _GLIBCXX_CONSTEXPR float
144 atan2(float __y, float __x)
145 { return __builtin_atan2f(__y, __x); }
147 inline _GLIBCXX_CONSTEXPR long double
148 atan2(long double __y, long double __x)
149 { return __builtin_atan2l(__y, __x); }
152 template<typename _Tp, typename _Up>
153 inline _GLIBCXX_CONSTEXPR
154 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
155 atan2(_Tp __y, _Up __x)
157 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
158 return atan2(__type(__y), __type(__x));
163 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
164 inline _GLIBCXX_CONSTEXPR float
166 { return __builtin_ceilf(__x); }
168 inline _GLIBCXX_CONSTEXPR long double
169 ceil(long double __x)
170 { return __builtin_ceill(__x); }
173 template<typename _Tp>
174 inline _GLIBCXX_CONSTEXPR
175 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
178 { return __builtin_ceil(__x); }
182 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
183 inline _GLIBCXX_CONSTEXPR float
185 { return __builtin_cosf(__x); }
187 inline _GLIBCXX_CONSTEXPR long double
189 { return __builtin_cosl(__x); }
192 template<typename _Tp>
193 inline _GLIBCXX_CONSTEXPR
194 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
197 { return __builtin_cos(__x); }
201 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
202 inline _GLIBCXX_CONSTEXPR float
204 { return __builtin_coshf(__x); }
206 inline _GLIBCXX_CONSTEXPR long double
207 cosh(long double __x)
208 { return __builtin_coshl(__x); }
211 template<typename _Tp>
212 inline _GLIBCXX_CONSTEXPR
213 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
216 { return __builtin_cosh(__x); }
220 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
221 inline _GLIBCXX_CONSTEXPR float
223 { return __builtin_expf(__x); }
225 inline _GLIBCXX_CONSTEXPR long double
227 { return __builtin_expl(__x); }
230 template<typename _Tp>
231 inline _GLIBCXX_CONSTEXPR
232 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
235 { return __builtin_exp(__x); }
239 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
240 inline _GLIBCXX_CONSTEXPR float
242 { return __builtin_fabsf(__x); }
244 inline _GLIBCXX_CONSTEXPR long double
245 fabs(long double __x)
246 { return __builtin_fabsl(__x); }
249 template<typename _Tp>
250 inline _GLIBCXX_CONSTEXPR
251 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
254 { return __builtin_fabs(__x); }
258 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
259 inline _GLIBCXX_CONSTEXPR float
261 { return __builtin_floorf(__x); }
263 inline _GLIBCXX_CONSTEXPR long double
264 floor(long double __x)
265 { return __builtin_floorl(__x); }
268 template<typename _Tp>
269 inline _GLIBCXX_CONSTEXPR
270 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
273 { return __builtin_floor(__x); }
277 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
278 inline _GLIBCXX_CONSTEXPR float
279 fmod(float __x, float __y)
280 { return __builtin_fmodf(__x, __y); }
282 inline _GLIBCXX_CONSTEXPR long double
283 fmod(long double __x, long double __y)
284 { return __builtin_fmodl(__x, __y); }
287 template<typename _Tp, typename _Up>
288 inline _GLIBCXX_CONSTEXPR
289 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
290 fmod(_Tp __x, _Up __y)
292 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
293 return fmod(__type(__x), __type(__y));
298 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
300 frexp(float __x, int* __exp)
301 { return __builtin_frexpf(__x, __exp); }
304 frexp(long double __x, int* __exp)
305 { return __builtin_frexpl(__x, __exp); }
308 template<typename _Tp>
309 inline _GLIBCXX_CONSTEXPR
310 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
312 frexp(_Tp __x, int* __exp)
313 { return __builtin_frexp(__x, __exp); }
317 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
318 inline _GLIBCXX_CONSTEXPR float
319 ldexp(float __x, int __exp)
320 { return __builtin_ldexpf(__x, __exp); }
322 inline _GLIBCXX_CONSTEXPR long double
323 ldexp(long double __x, int __exp)
324 { return __builtin_ldexpl(__x, __exp); }
327 template<typename _Tp>
328 inline _GLIBCXX_CONSTEXPR
329 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
331 ldexp(_Tp __x, int __exp)
332 { return __builtin_ldexp(__x, __exp); }
336 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
337 inline _GLIBCXX_CONSTEXPR float
339 { return __builtin_logf(__x); }
341 inline _GLIBCXX_CONSTEXPR long double
343 { return __builtin_logl(__x); }
346 template<typename _Tp>
347 inline _GLIBCXX_CONSTEXPR
348 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
351 { return __builtin_log(__x); }
355 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
356 inline _GLIBCXX_CONSTEXPR float
358 { return __builtin_log10f(__x); }
360 inline _GLIBCXX_CONSTEXPR long double
361 log10(long double __x)
362 { return __builtin_log10l(__x); }
365 template<typename _Tp>
366 inline _GLIBCXX_CONSTEXPR
367 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
370 { return __builtin_log10(__x); }
374 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
376 modf(float __x, float* __iptr)
377 { return __builtin_modff(__x, __iptr); }
380 modf(long double __x, long double* __iptr)
381 { return __builtin_modfl(__x, __iptr); }
386 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
387 inline _GLIBCXX_CONSTEXPR float
388 pow(float __x, float __y)
389 { return __builtin_powf(__x, __y); }
391 inline _GLIBCXX_CONSTEXPR long double
392 pow(long double __x, long double __y)
393 { return __builtin_powl(__x, __y); }
395 #if __cplusplus < 201103L
396 // _GLIBCXX_RESOLVE_LIB_DEFECTS
397 // DR 550. What should the return type of pow(float,int) be?
399 pow(double __x, int __i)
400 { return __builtin_powi(__x, __i); }
403 pow(float __x, int __n)
404 { return __builtin_powif(__x, __n); }
407 pow(long double __x, int __n)
408 { return __builtin_powil(__x, __n); }
412 template<typename _Tp, typename _Up>
413 inline _GLIBCXX_CONSTEXPR
414 typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
415 pow(_Tp __x, _Up __y)
417 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
418 return pow(__type(__x), __type(__y));
423 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
424 inline _GLIBCXX_CONSTEXPR float
426 { return __builtin_sinf(__x); }
428 inline _GLIBCXX_CONSTEXPR long double
430 { return __builtin_sinl(__x); }
433 template<typename _Tp>
434 inline _GLIBCXX_CONSTEXPR
435 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
438 { return __builtin_sin(__x); }
442 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
443 inline _GLIBCXX_CONSTEXPR float
445 { return __builtin_sinhf(__x); }
447 inline _GLIBCXX_CONSTEXPR long double
448 sinh(long double __x)
449 { return __builtin_sinhl(__x); }
452 template<typename _Tp>
453 inline _GLIBCXX_CONSTEXPR
454 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
457 { return __builtin_sinh(__x); }
461 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
462 inline _GLIBCXX_CONSTEXPR float
464 { return __builtin_sqrtf(__x); }
466 inline _GLIBCXX_CONSTEXPR long double
467 sqrt(long double __x)
468 { return __builtin_sqrtl(__x); }
471 template<typename _Tp>
472 inline _GLIBCXX_CONSTEXPR
473 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
476 { return __builtin_sqrt(__x); }
480 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
481 inline _GLIBCXX_CONSTEXPR float
483 { return __builtin_tanf(__x); }
485 inline _GLIBCXX_CONSTEXPR long double
487 { return __builtin_tanl(__x); }
490 template<typename _Tp>
491 inline _GLIBCXX_CONSTEXPR
492 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
495 { return __builtin_tan(__x); }
499 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
500 inline _GLIBCXX_CONSTEXPR float
502 { return __builtin_tanhf(__x); }
504 inline _GLIBCXX_CONSTEXPR long double
505 tanh(long double __x)
506 { return __builtin_tanhl(__x); }
509 template<typename _Tp>
510 inline _GLIBCXX_CONSTEXPR
511 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
514 { return __builtin_tanh(__x); }
516 _GLIBCXX_END_NAMESPACE_VERSION
519 #if _GLIBCXX_USE_C99_MATH
520 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
522 // These are possible macros imported from C99-land.
530 #undef isgreaterequal
536 namespace std _GLIBCXX_VISIBILITY(default)
538 _GLIBCXX_BEGIN_NAMESPACE_VERSION
540 #if __cplusplus >= 201103L
542 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
544 fpclassify(float __x)
545 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
546 FP_SUBNORMAL, FP_ZERO, __x); }
549 fpclassify(double __x)
550 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
551 FP_SUBNORMAL, FP_ZERO, __x); }
554 fpclassify(long double __x)
555 { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
556 FP_SUBNORMAL, FP_ZERO, __x); }
559 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
560 template<typename _Tp>
561 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
564 { return __x != 0 ? FP_NORMAL : FP_ZERO; }
567 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
570 { return __builtin_isfinite(__x); }
574 { return __builtin_isfinite(__x); }
577 isfinite(long double __x)
578 { return __builtin_isfinite(__x); }
581 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
582 template<typename _Tp>
583 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
589 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
592 { return __builtin_isinf(__x); }
594 #if _GLIBCXX_HAVE_OBSOLETE_ISINF \
595 && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC
600 { return __builtin_isinf(__x); }
604 isinf(long double __x)
605 { return __builtin_isinf(__x); }
608 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
609 template<typename _Tp>
610 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
616 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
619 { return __builtin_isnan(__x); }
621 #if _GLIBCXX_HAVE_OBSOLETE_ISNAN \
622 && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC
627 { return __builtin_isnan(__x); }
631 isnan(long double __x)
632 { return __builtin_isnan(__x); }
635 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
636 template<typename _Tp>
637 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
643 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
646 { return __builtin_isnormal(__x); }
650 { return __builtin_isnormal(__x); }
653 isnormal(long double __x)
654 { return __builtin_isnormal(__x); }
657 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
658 template<typename _Tp>
659 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
662 { return __x != 0 ? true : false; }
665 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
666 // Note: middle-end/36757 is fixed, __builtin_signbit is type-generic.
669 { return __builtin_signbit(__x); }
673 { return __builtin_signbit(__x); }
676 signbit(long double __x)
677 { return __builtin_signbit(__x); }
680 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
681 template<typename _Tp>
682 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
685 { return __x < 0 ? true : false; }
688 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
690 isgreater(float __x, float __y)
691 { return __builtin_isgreater(__x, __y); }
694 isgreater(double __x, double __y)
695 { return __builtin_isgreater(__x, __y); }
698 isgreater(long double __x, long double __y)
699 { return __builtin_isgreater(__x, __y); }
702 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
703 template<typename _Tp, typename _Up>
705 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
706 && __is_arithmetic<_Up>::__value), bool>::__type
707 isgreater(_Tp __x, _Up __y)
709 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
710 return __builtin_isgreater(__type(__x), __type(__y));
714 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
716 isgreaterequal(float __x, float __y)
717 { return __builtin_isgreaterequal(__x, __y); }
720 isgreaterequal(double __x, double __y)
721 { return __builtin_isgreaterequal(__x, __y); }
724 isgreaterequal(long double __x, long double __y)
725 { return __builtin_isgreaterequal(__x, __y); }
728 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
729 template<typename _Tp, typename _Up>
731 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
732 && __is_arithmetic<_Up>::__value), bool>::__type
733 isgreaterequal(_Tp __x, _Up __y)
735 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
736 return __builtin_isgreaterequal(__type(__x), __type(__y));
740 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
742 isless(float __x, float __y)
743 { return __builtin_isless(__x, __y); }
746 isless(double __x, double __y)
747 { return __builtin_isless(__x, __y); }
750 isless(long double __x, long double __y)
751 { return __builtin_isless(__x, __y); }
754 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
755 template<typename _Tp, typename _Up>
757 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
758 && __is_arithmetic<_Up>::__value), bool>::__type
759 isless(_Tp __x, _Up __y)
761 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
762 return __builtin_isless(__type(__x), __type(__y));
766 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
768 islessequal(float __x, float __y)
769 { return __builtin_islessequal(__x, __y); }
772 islessequal(double __x, double __y)
773 { return __builtin_islessequal(__x, __y); }
776 islessequal(long double __x, long double __y)
777 { return __builtin_islessequal(__x, __y); }
780 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
781 template<typename _Tp, typename _Up>
783 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
784 && __is_arithmetic<_Up>::__value), bool>::__type
785 islessequal(_Tp __x, _Up __y)
787 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
788 return __builtin_islessequal(__type(__x), __type(__y));
792 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
794 islessgreater(float __x, float __y)
795 { return __builtin_islessgreater(__x, __y); }
798 islessgreater(double __x, double __y)
799 { return __builtin_islessgreater(__x, __y); }
802 islessgreater(long double __x, long double __y)
803 { return __builtin_islessgreater(__x, __y); }
806 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
807 template<typename _Tp, typename _Up>
809 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
810 && __is_arithmetic<_Up>::__value), bool>::__type
811 islessgreater(_Tp __x, _Up __y)
813 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
814 return __builtin_islessgreater(__type(__x), __type(__y));
818 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
820 isunordered(float __x, float __y)
821 { return __builtin_isunordered(__x, __y); }
824 isunordered(double __x, double __y)
825 { return __builtin_isunordered(__x, __y); }
828 isunordered(long double __x, long double __y)
829 { return __builtin_isunordered(__x, __y); }
832 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
833 template<typename _Tp, typename _Up>
835 __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
836 && __is_arithmetic<_Up>::__value), bool>::__type
837 isunordered(_Tp __x, _Up __y)
839 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
840 return __builtin_isunordered(__type(__x), __type(__y));
846 template<typename _Tp>
847 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
851 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
852 return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
853 FP_SUBNORMAL, FP_ZERO, __type(__f));
856 template<typename _Tp>
857 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
861 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
862 return __builtin_isfinite(__type(__f));
865 template<typename _Tp>
866 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
870 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
871 return __builtin_isinf(__type(__f));
874 template<typename _Tp>
875 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
879 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
880 return __builtin_isnan(__type(__f));
883 template<typename _Tp>
884 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
888 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
889 return __builtin_isnormal(__type(__f));
892 template<typename _Tp>
893 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
897 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
898 return __builtin_signbit(__type(__f));
901 template<typename _Tp>
902 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
904 isgreater(_Tp __f1, _Tp __f2)
906 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
907 return __builtin_isgreater(__type(__f1), __type(__f2));
910 template<typename _Tp>
911 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
913 isgreaterequal(_Tp __f1, _Tp __f2)
915 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
916 return __builtin_isgreaterequal(__type(__f1), __type(__f2));
919 template<typename _Tp>
920 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
922 isless(_Tp __f1, _Tp __f2)
924 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
925 return __builtin_isless(__type(__f1), __type(__f2));
928 template<typename _Tp>
929 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
931 islessequal(_Tp __f1, _Tp __f2)
933 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
934 return __builtin_islessequal(__type(__f1), __type(__f2));
937 template<typename _Tp>
938 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
940 islessgreater(_Tp __f1, _Tp __f2)
942 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
943 return __builtin_islessgreater(__type(__f1), __type(__f2));
946 template<typename _Tp>
947 inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
949 isunordered(_Tp __f1, _Tp __f2)
951 typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
952 return __builtin_isunordered(__type(__f1), __type(__f2));
957 _GLIBCXX_END_NAMESPACE_VERSION
960 #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
963 #if __cplusplus >= 201103L
965 #ifdef _GLIBCXX_USE_C99_MATH_TR1
1073 namespace std _GLIBCXX_VISIBILITY(default)
1075 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1187 using ::nexttowardf;
1188 using ::nexttowardl;
1222 /// Additional overloads.
1223 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1226 { return __builtin_acoshf(__x); }
1228 constexpr long double
1229 acosh(long double __x)
1230 { return __builtin_acoshl(__x); }
1233 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1234 template<typename _Tp>
1235 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1238 { return __builtin_acosh(__x); }
1241 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1244 { return __builtin_asinhf(__x); }
1246 constexpr long double
1247 asinh(long double __x)
1248 { return __builtin_asinhl(__x); }
1251 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1252 template<typename _Tp>
1253 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1256 { return __builtin_asinh(__x); }
1259 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1262 { return __builtin_atanhf(__x); }
1264 constexpr long double
1265 atanh(long double __x)
1266 { return __builtin_atanhl(__x); }
1269 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1270 template<typename _Tp>
1271 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1274 { return __builtin_atanh(__x); }
1277 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1280 { return __builtin_cbrtf(__x); }
1282 constexpr long double
1283 cbrt(long double __x)
1284 { return __builtin_cbrtl(__x); }
1287 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1288 template<typename _Tp>
1289 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1292 { return __builtin_cbrt(__x); }
1295 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1297 copysign(float __x, float __y)
1298 { return __builtin_copysignf(__x, __y); }
1300 constexpr long double
1301 copysign(long double __x, long double __y)
1302 { return __builtin_copysignl(__x, __y); }
1305 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1306 template<typename _Tp, typename _Up>
1307 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1308 copysign(_Tp __x, _Up __y)
1310 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1311 return copysign(__type(__x), __type(__y));
1315 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1318 { return __builtin_erff(__x); }
1320 constexpr long double
1321 erf(long double __x)
1322 { return __builtin_erfl(__x); }
1325 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1326 template<typename _Tp>
1327 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1330 { return __builtin_erf(__x); }
1333 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1336 { return __builtin_erfcf(__x); }
1338 constexpr long double
1339 erfc(long double __x)
1340 { return __builtin_erfcl(__x); }
1343 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1344 template<typename _Tp>
1345 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1348 { return __builtin_erfc(__x); }
1351 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1354 { return __builtin_exp2f(__x); }
1356 constexpr long double
1357 exp2(long double __x)
1358 { return __builtin_exp2l(__x); }
1361 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1362 template<typename _Tp>
1363 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1366 { return __builtin_exp2(__x); }
1369 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1372 { return __builtin_expm1f(__x); }
1374 constexpr long double
1375 expm1(long double __x)
1376 { return __builtin_expm1l(__x); }
1379 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1380 template<typename _Tp>
1381 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1384 { return __builtin_expm1(__x); }
1387 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1389 fdim(float __x, float __y)
1390 { return __builtin_fdimf(__x, __y); }
1392 constexpr long double
1393 fdim(long double __x, long double __y)
1394 { return __builtin_fdiml(__x, __y); }
1397 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1398 template<typename _Tp, typename _Up>
1399 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1400 fdim(_Tp __x, _Up __y)
1402 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1403 return fdim(__type(__x), __type(__y));
1407 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1409 fma(float __x, float __y, float __z)
1410 { return __builtin_fmaf(__x, __y, __z); }
1412 constexpr long double
1413 fma(long double __x, long double __y, long double __z)
1414 { return __builtin_fmal(__x, __y, __z); }
1417 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1418 template<typename _Tp, typename _Up, typename _Vp>
1419 constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
1420 fma(_Tp __x, _Up __y, _Vp __z)
1422 typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
1423 return fma(__type(__x), __type(__y), __type(__z));
1427 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1429 fmax(float __x, float __y)
1430 { return __builtin_fmaxf(__x, __y); }
1432 constexpr long double
1433 fmax(long double __x, long double __y)
1434 { return __builtin_fmaxl(__x, __y); }
1437 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1438 template<typename _Tp, typename _Up>
1439 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1440 fmax(_Tp __x, _Up __y)
1442 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1443 return fmax(__type(__x), __type(__y));
1447 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1449 fmin(float __x, float __y)
1450 { return __builtin_fminf(__x, __y); }
1452 constexpr long double
1453 fmin(long double __x, long double __y)
1454 { return __builtin_fminl(__x, __y); }
1457 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1458 template<typename _Tp, typename _Up>
1459 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1460 fmin(_Tp __x, _Up __y)
1462 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1463 return fmin(__type(__x), __type(__y));
1467 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1469 hypot(float __x, float __y)
1470 { return __builtin_hypotf(__x, __y); }
1472 constexpr long double
1473 hypot(long double __x, long double __y)
1474 { return __builtin_hypotl(__x, __y); }
1477 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1478 template<typename _Tp, typename _Up>
1479 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1480 hypot(_Tp __x, _Up __y)
1482 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1483 return hypot(__type(__x), __type(__y));
1487 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1490 { return __builtin_ilogbf(__x); }
1493 ilogb(long double __x)
1494 { return __builtin_ilogbl(__x); }
1497 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1498 template<typename _Tp>
1500 typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1503 { return __builtin_ilogb(__x); }
1506 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1509 { return __builtin_lgammaf(__x); }
1511 constexpr long double
1512 lgamma(long double __x)
1513 { return __builtin_lgammal(__x); }
1516 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1517 template<typename _Tp>
1518 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1521 { return __builtin_lgamma(__x); }
1524 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1527 { return __builtin_llrintf(__x); }
1530 llrint(long double __x)
1531 { return __builtin_llrintl(__x); }
1534 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1535 template<typename _Tp>
1536 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1539 { return __builtin_llrint(__x); }
1542 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1545 { return __builtin_llroundf(__x); }
1548 llround(long double __x)
1549 { return __builtin_llroundl(__x); }
1552 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1553 template<typename _Tp>
1554 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1557 { return __builtin_llround(__x); }
1560 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1563 { return __builtin_log1pf(__x); }
1565 constexpr long double
1566 log1p(long double __x)
1567 { return __builtin_log1pl(__x); }
1570 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1571 template<typename _Tp>
1572 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1575 { return __builtin_log1p(__x); }
1578 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1582 { return __builtin_log2f(__x); }
1584 constexpr long double
1585 log2(long double __x)
1586 { return __builtin_log2l(__x); }
1589 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1590 template<typename _Tp>
1591 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1594 { return __builtin_log2(__x); }
1597 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1600 { return __builtin_logbf(__x); }
1602 constexpr long double
1603 logb(long double __x)
1604 { return __builtin_logbl(__x); }
1607 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1608 template<typename _Tp>
1609 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1612 { return __builtin_logb(__x); }
1615 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1618 { return __builtin_lrintf(__x); }
1621 lrint(long double __x)
1622 { return __builtin_lrintl(__x); }
1625 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1626 template<typename _Tp>
1627 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1630 { return __builtin_lrint(__x); }
1633 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1636 { return __builtin_lroundf(__x); }
1639 lround(long double __x)
1640 { return __builtin_lroundl(__x); }
1643 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1644 template<typename _Tp>
1645 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1648 { return __builtin_lround(__x); }
1651 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1653 nearbyint(float __x)
1654 { return __builtin_nearbyintf(__x); }
1656 constexpr long double
1657 nearbyint(long double __x)
1658 { return __builtin_nearbyintl(__x); }
1661 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1662 template<typename _Tp>
1663 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1666 { return __builtin_nearbyint(__x); }
1669 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1671 nextafter(float __x, float __y)
1672 { return __builtin_nextafterf(__x, __y); }
1674 constexpr long double
1675 nextafter(long double __x, long double __y)
1676 { return __builtin_nextafterl(__x, __y); }
1679 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1680 template<typename _Tp, typename _Up>
1681 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1682 nextafter(_Tp __x, _Up __y)
1684 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1685 return nextafter(__type(__x), __type(__y));
1689 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1691 nexttoward(float __x, long double __y)
1692 { return __builtin_nexttowardf(__x, __y); }
1694 constexpr long double
1695 nexttoward(long double __x, long double __y)
1696 { return __builtin_nexttowardl(__x, __y); }
1699 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1700 template<typename _Tp>
1701 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1703 nexttoward(_Tp __x, long double __y)
1704 { return __builtin_nexttoward(__x, __y); }
1707 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1709 remainder(float __x, float __y)
1710 { return __builtin_remainderf(__x, __y); }
1712 constexpr long double
1713 remainder(long double __x, long double __y)
1714 { return __builtin_remainderl(__x, __y); }
1717 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1718 template<typename _Tp, typename _Up>
1719 constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1720 remainder(_Tp __x, _Up __y)
1722 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1723 return remainder(__type(__x), __type(__y));
1727 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1729 remquo(float __x, float __y, int* __pquo)
1730 { return __builtin_remquof(__x, __y, __pquo); }
1733 remquo(long double __x, long double __y, int* __pquo)
1734 { return __builtin_remquol(__x, __y, __pquo); }
1737 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1738 template<typename _Tp, typename _Up>
1739 inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1740 remquo(_Tp __x, _Up __y, int* __pquo)
1742 typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1743 return remquo(__type(__x), __type(__y), __pquo);
1747 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1750 { return __builtin_rintf(__x); }
1752 constexpr long double
1753 rint(long double __x)
1754 { return __builtin_rintl(__x); }
1757 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1758 template<typename _Tp>
1759 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1762 { return __builtin_rint(__x); }
1765 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1768 { return __builtin_roundf(__x); }
1770 constexpr long double
1771 round(long double __x)
1772 { return __builtin_roundl(__x); }
1775 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1776 template<typename _Tp>
1777 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1780 { return __builtin_round(__x); }
1783 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1785 scalbln(float __x, long __ex)
1786 { return __builtin_scalblnf(__x, __ex); }
1788 constexpr long double
1789 scalbln(long double __x, long __ex)
1790 { return __builtin_scalblnl(__x, __ex); }
1793 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1794 template<typename _Tp>
1795 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1797 scalbln(_Tp __x, long __ex)
1798 { return __builtin_scalbln(__x, __ex); }
1801 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1803 scalbn(float __x, int __ex)
1804 { return __builtin_scalbnf(__x, __ex); }
1806 constexpr long double
1807 scalbn(long double __x, int __ex)
1808 { return __builtin_scalbnl(__x, __ex); }
1811 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1812 template<typename _Tp>
1813 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1815 scalbn(_Tp __x, int __ex)
1816 { return __builtin_scalbn(__x, __ex); }
1819 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1822 { return __builtin_tgammaf(__x); }
1824 constexpr long double
1825 tgamma(long double __x)
1826 { return __builtin_tgammal(__x); }
1829 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1830 template<typename _Tp>
1831 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1834 { return __builtin_tgamma(__x); }
1837 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
1840 { return __builtin_truncf(__x); }
1842 constexpr long double
1843 trunc(long double __x)
1844 { return __builtin_truncl(__x); }
1847 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT
1848 template<typename _Tp>
1849 constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1852 { return __builtin_trunc(__x); }
1855 _GLIBCXX_END_NAMESPACE_VERSION
1858 #endif // _GLIBCXX_USE_C99_MATH_TR1
1862 #if __cplusplus > 201402L
1863 namespace std _GLIBCXX_VISIBILITY(default)
1865 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1867 // [c.math.hypot3], three-dimensional hypotenuse
1868 #define __cpp_lib_hypot 201603
1870 template<typename _Tp>
1872 __hypot3(_Tp __x, _Tp __y, _Tp __z)
1874 __x = std::abs(__x);
1875 __y = std::abs(__y);
1876 __z = std::abs(__z);
1877 if (_Tp __a = __x < __y ? __y < __z ? __z : __y : __x < __z ? __z : __x)
1878 return __a * std::sqrt((__x / __a) * (__x / __a)
1879 + (__y / __a) * (__y / __a)
1880 + (__z / __a) * (__z / __a));
1886 hypot(float __x, float __y, float __z)
1887 { return std::__hypot3<float>(__x, __y, __z); }
1890 hypot(double __x, double __y, double __z)
1891 { return std::__hypot3<double>(__x, __y, __z); }
1894 hypot(long double __x, long double __y, long double __z)
1895 { return std::__hypot3<long double>(__x, __y, __z); }
1897 template<typename _Tp, typename _Up, typename _Vp>
1898 typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
1899 hypot(_Tp __x, _Up __y, _Vp __z)
1901 using __type = typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type;
1902 return std::__hypot3<__type>(__x, __y, __z);
1904 _GLIBCXX_END_NAMESPACE_VERSION
1909 #if _GLIBCXX_USE_STD_SPEC_FUNCS
1910 # include <bits/specfun.h>