2 //===---------------------------- cmath -----------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
36 math_errhandling // C99
48 floating_point abs(floating_point x);
50 floating_point acos (arithmetic x);
52 long double acosl(long double x);
54 floating_point asin (arithmetic x);
56 long double asinl(long double x);
58 floating_point atan (arithmetic x);
60 long double atanl(long double x);
62 floating_point atan2 (arithmetic y, arithmetic x);
63 float atan2f(float y, float x);
64 long double atan2l(long double y, long double x);
66 floating_point ceil (arithmetic x);
68 long double ceill(long double x);
70 floating_point cos (arithmetic x);
72 long double cosl(long double x);
74 floating_point cosh (arithmetic x);
76 long double coshl(long double x);
78 floating_point exp (arithmetic x);
80 long double expl(long double x);
82 floating_point fabs (arithmetic x);
84 long double fabsl(long double x);
86 floating_point floor (arithmetic x);
87 float floorf(float x);
88 long double floorl(long double x);
90 floating_point fmod (arithmetic x, arithmetic y);
91 float fmodf(float x, float y);
92 long double fmodl(long double x, long double y);
94 floating_point frexp (arithmetic value, int* exp);
95 float frexpf(float value, int* exp);
96 long double frexpl(long double value, int* exp);
98 floating_point ldexp (arithmetic value, int exp);
99 float ldexpf(float value, int exp);
100 long double ldexpl(long double value, int exp);
102 floating_point log (arithmetic x);
104 long double logl(long double x);
106 floating_point log10 (arithmetic x);
107 float log10f(float x);
108 long double log10l(long double x);
110 floating_point modf (floating_point value, floating_point* iptr);
111 float modff(float value, float* iptr);
112 long double modfl(long double value, long double* iptr);
114 floating_point pow (arithmetic x, arithmetic y);
115 float powf(float x, float y);
116 long double powl(long double x, long double y);
118 floating_point sin (arithmetic x);
120 long double sinl(long double x);
122 floating_point sinh (arithmetic x);
123 float sinhf(float x);
124 long double sinhl(long double x);
126 floating_point sqrt (arithmetic x);
127 float sqrtf(float x);
128 long double sqrtl(long double x);
130 floating_point tan (arithmetic x);
132 long double tanl(long double x);
134 floating_point tanh (arithmetic x);
135 float tanhf(float x);
136 long double tanhl(long double x);
140 bool signbit(arithmetic x);
142 int fpclassify(arithmetic x);
144 bool isfinite(arithmetic x);
145 bool isinf(arithmetic x);
146 bool isnan(arithmetic x);
147 bool isnormal(arithmetic x);
149 bool isgreater(arithmetic x, arithmetic y);
150 bool isgreaterequal(arithmetic x, arithmetic y);
151 bool isless(arithmetic x, arithmetic y);
152 bool islessequal(arithmetic x, arithmetic y);
153 bool islessgreater(arithmetic x, arithmetic y);
154 bool isunordered(arithmetic x, arithmetic y);
156 floating_point acosh (arithmetic x);
157 float acoshf(float x);
158 long double acoshl(long double x);
160 floating_point asinh (arithmetic x);
161 float asinhf(float x);
162 long double asinhl(long double x);
164 floating_point atanh (arithmetic x);
165 float atanhf(float x);
166 long double atanhl(long double x);
168 floating_point cbrt (arithmetic x);
169 float cbrtf(float x);
170 long double cbrtl(long double x);
172 floating_point copysign (arithmetic x, arithmetic y);
173 float copysignf(float x, float y);
174 long double copysignl(long double x, long double y);
176 floating_point erf (arithmetic x);
178 long double erfl(long double x);
180 floating_point erfc (arithmetic x);
181 float erfcf(float x);
182 long double erfcl(long double x);
184 floating_point exp2 (arithmetic x);
185 float exp2f(float x);
186 long double exp2l(long double x);
188 floating_point expm1 (arithmetic x);
189 float expm1f(float x);
190 long double expm1l(long double x);
192 floating_point fdim (arithmetic x, arithmetic y);
193 float fdimf(float x, float y);
194 long double fdiml(long double x, long double y);
196 floating_point fma (arithmetic x, arithmetic y, arithmetic z);
197 float fmaf(float x, float y, float z);
198 long double fmal(long double x, long double y, long double z);
200 floating_point fmax (arithmetic x, arithmetic y);
201 float fmaxf(float x, float y);
202 long double fmaxl(long double x, long double y);
204 floating_point fmin (arithmetic x, arithmetic y);
205 float fminf(float x, float y);
206 long double fminl(long double x, long double y);
208 floating_point hypot (arithmetic x, arithmetic y);
209 float hypotf(float x, float y);
210 long double hypotl(long double x, long double y);
212 int ilogb (arithmetic x);
214 int ilogbl(long double x);
216 floating_point lgamma (arithmetic x);
217 float lgammaf(float x);
218 long double lgammal(long double x);
220 long long llrint (arithmetic x);
221 long long llrintf(float x);
222 long long llrintl(long double x);
224 long long llround (arithmetic x);
225 long long llroundf(float x);
226 long long llroundl(long double x);
228 floating_point log1p (arithmetic x);
229 float log1pf(float x);
230 long double log1pl(long double x);
232 floating_point log2 (arithmetic x);
233 float log2f(float x);
234 long double log2l(long double x);
236 floating_point logb (arithmetic x);
237 float logbf(float x);
238 long double logbl(long double x);
240 long lrint (arithmetic x);
241 long lrintf(float x);
242 long lrintl(long double x);
244 long lround (arithmetic x);
245 long lroundf(float x);
246 long lroundl(long double x);
248 double nan (const char* str);
249 float nanf(const char* str);
250 long double nanl(const char* str);
252 floating_point nearbyint (arithmetic x);
253 float nearbyintf(float x);
254 long double nearbyintl(long double x);
256 floating_point nextafter (arithmetic x, arithmetic y);
257 float nextafterf(float x, float y);
258 long double nextafterl(long double x, long double y);
260 floating_point nexttoward (arithmetic x, long double y);
261 float nexttowardf(float x, long double y);
262 long double nexttowardl(long double x, long double y);
264 floating_point remainder (arithmetic x, arithmetic y);
265 float remainderf(float x, float y);
266 long double remainderl(long double x, long double y);
268 floating_point remquo (arithmetic x, arithmetic y, int* pquo);
269 float remquof(float x, float y, int* pquo);
270 long double remquol(long double x, long double y, int* pquo);
272 floating_point rint (arithmetic x);
273 float rintf(float x);
274 long double rintl(long double x);
276 floating_point round (arithmetic x);
277 float roundf(float x);
278 long double roundl(long double x);
280 floating_point scalbln (arithmetic x, long ex);
281 float scalblnf(float x, long ex);
282 long double scalblnl(long double x, long ex);
284 floating_point scalbn (arithmetic x, int ex);
285 float scalbnf(float x, int ex);
286 long double scalbnl(long double x, int ex);
288 floating_point tgamma (arithmetic x);
289 float tgammaf(float x);
290 long double tgammal(long double x);
292 floating_point trunc (arithmetic x);
293 float truncf(float x);
294 long double truncl(long double x);
302 #include <type_traits>
304 #ifdef _LIBCPP_MSVCRT
305 #include "support/win32/math_win32.h"
308 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
309 #pragma GCC system_header
317 _LIBCPP_ALWAYS_INLINE
319 __libcpp_signbit(_A1 __x) _NOEXCEPT
327 inline _LIBCPP_INLINE_VISIBILITY
328 typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
329 signbit(_A1 __x) _NOEXCEPT
331 return __libcpp_signbit((typename std::__promote<_A1>::type)__x);
341 _LIBCPP_ALWAYS_INLINE
343 __libcpp_fpclassify(_A1 __x) _NOEXCEPT
345 return fpclassify(__x);
351 inline _LIBCPP_INLINE_VISIBILITY
352 typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
353 fpclassify(_A1 __x) _NOEXCEPT
355 return __libcpp_fpclassify((typename std::__promote<_A1>::type)__x);
365 _LIBCPP_ALWAYS_INLINE
367 __libcpp_isfinite(_A1 __x) _NOEXCEPT
369 return isfinite(__x);
375 inline _LIBCPP_INLINE_VISIBILITY
376 typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
377 isfinite(_A1 __x) _NOEXCEPT
379 return __libcpp_isfinite((typename std::__promote<_A1>::type)__x);
389 _LIBCPP_ALWAYS_INLINE
391 __libcpp_isinf(_A1 __x) _NOEXCEPT
399 inline _LIBCPP_INLINE_VISIBILITY
400 typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
401 isinf(_A1 __x) _NOEXCEPT
403 return __libcpp_isinf((typename std::__promote<_A1>::type)__x);
413 _LIBCPP_ALWAYS_INLINE
415 __libcpp_isnan(_A1 __x) _NOEXCEPT
423 inline _LIBCPP_INLINE_VISIBILITY
424 typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
425 isnan(_A1 __x) _NOEXCEPT
427 return __libcpp_isnan((typename std::__promote<_A1>::type)__x);
437 _LIBCPP_ALWAYS_INLINE
439 __libcpp_isnormal(_A1 __x) _NOEXCEPT
441 return isnormal(__x);
447 inline _LIBCPP_INLINE_VISIBILITY
448 typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
449 isnormal(_A1 __x) _NOEXCEPT
451 return __libcpp_isnormal((typename std::__promote<_A1>::type)__x);
460 template <class _A1, class _A2>
461 _LIBCPP_ALWAYS_INLINE
463 __libcpp_isgreater(_A1 __x, _A2 __y) _NOEXCEPT
465 return isgreater(__x, __y);
470 template <class _A1, class _A2>
471 inline _LIBCPP_INLINE_VISIBILITY
472 typename std::enable_if
474 std::is_arithmetic<_A1>::value &&
475 std::is_arithmetic<_A2>::value,
478 isgreater(_A1 __x, _A2 __y) _NOEXCEPT
480 typedef typename std::__promote<_A1, _A2>::type type;
481 return __libcpp_isgreater((type)__x, (type)__y);
488 #ifdef isgreaterequal
490 template <class _A1, class _A2>
491 _LIBCPP_ALWAYS_INLINE
493 __libcpp_isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT
495 return isgreaterequal(__x, __y);
498 #undef isgreaterequal
500 template <class _A1, class _A2>
501 inline _LIBCPP_INLINE_VISIBILITY
502 typename std::enable_if
504 std::is_arithmetic<_A1>::value &&
505 std::is_arithmetic<_A2>::value,
508 isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT
510 typedef typename std::__promote<_A1, _A2>::type type;
511 return __libcpp_isgreaterequal((type)__x, (type)__y);
514 #endif // isgreaterequal
520 template <class _A1, class _A2>
521 _LIBCPP_ALWAYS_INLINE
523 __libcpp_isless(_A1 __x, _A2 __y) _NOEXCEPT
525 return isless(__x, __y);
530 template <class _A1, class _A2>
531 inline _LIBCPP_INLINE_VISIBILITY
532 typename std::enable_if
534 std::is_arithmetic<_A1>::value &&
535 std::is_arithmetic<_A2>::value,
538 isless(_A1 __x, _A2 __y) _NOEXCEPT
540 typedef typename std::__promote<_A1, _A2>::type type;
541 return __libcpp_isless((type)__x, (type)__y);
550 template <class _A1, class _A2>
551 _LIBCPP_ALWAYS_INLINE
553 __libcpp_islessequal(_A1 __x, _A2 __y) _NOEXCEPT
555 return islessequal(__x, __y);
560 template <class _A1, class _A2>
561 inline _LIBCPP_INLINE_VISIBILITY
562 typename std::enable_if
564 std::is_arithmetic<_A1>::value &&
565 std::is_arithmetic<_A2>::value,
568 islessequal(_A1 __x, _A2 __y) _NOEXCEPT
570 typedef typename std::__promote<_A1, _A2>::type type;
571 return __libcpp_islessequal((type)__x, (type)__y);
574 #endif // islessequal
580 template <class _A1, class _A2>
581 _LIBCPP_ALWAYS_INLINE
583 __libcpp_islessgreater(_A1 __x, _A2 __y) _NOEXCEPT
585 return islessgreater(__x, __y);
590 template <class _A1, class _A2>
591 inline _LIBCPP_INLINE_VISIBILITY
592 typename std::enable_if
594 std::is_arithmetic<_A1>::value &&
595 std::is_arithmetic<_A2>::value,
598 islessgreater(_A1 __x, _A2 __y) _NOEXCEPT
600 typedef typename std::__promote<_A1, _A2>::type type;
601 return __libcpp_islessgreater((type)__x, (type)__y);
604 #endif // islessgreater
610 template <class _A1, class _A2>
611 _LIBCPP_ALWAYS_INLINE
613 __libcpp_isunordered(_A1 __x, _A2 __y) _NOEXCEPT
615 return isunordered(__x, __y);
620 template <class _A1, class _A2>
621 inline _LIBCPP_INLINE_VISIBILITY
622 typename std::enable_if
624 std::is_arithmetic<_A1>::value &&
625 std::is_arithmetic<_A2>::value,
628 isunordered(_A1 __x, _A2 __y) _NOEXCEPT
630 typedef typename std::__promote<_A1, _A2>::type type;
631 return __libcpp_isunordered((type)__x, (type)__y);
634 #endif // isunordered
636 _LIBCPP_BEGIN_NAMESPACE_STD
645 using ::isgreaterequal;
648 using ::islessgreater;
658 inline _LIBCPP_INLINE_VISIBILITY
660 abs(float __x) _NOEXCEPT {return fabsf(__x);}
662 inline _LIBCPP_INLINE_VISIBILITY
664 abs(double __x) _NOEXCEPT {return fabs(__x);}
666 inline _LIBCPP_INLINE_VISIBILITY
668 abs(long double __x) _NOEXCEPT {return fabsl(__x);}
669 #endif // !defined(_AIX)
678 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
679 inline _LIBCPP_INLINE_VISIBILITY float acos(float __x) _NOEXCEPT {return acosf(__x);}
680 inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) _NOEXCEPT {return acosl(__x);}
684 inline _LIBCPP_INLINE_VISIBILITY
685 typename enable_if<is_integral<_A1>::value, double>::type
686 acos(_A1 __x) _NOEXCEPT {return acos((double)__x);}
693 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
694 inline _LIBCPP_INLINE_VISIBILITY float asin(float __x) _NOEXCEPT {return asinf(__x);}
695 inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) _NOEXCEPT {return asinl(__x);}
699 inline _LIBCPP_INLINE_VISIBILITY
700 typename enable_if<is_integral<_A1>::value, double>::type
701 asin(_A1 __x) _NOEXCEPT {return asin((double)__x);}
708 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
709 inline _LIBCPP_INLINE_VISIBILITY float atan(float __x) _NOEXCEPT {return atanf(__x);}
710 inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) _NOEXCEPT {return atanl(__x);}
714 inline _LIBCPP_INLINE_VISIBILITY
715 typename enable_if<is_integral<_A1>::value, double>::type
716 atan(_A1 __x) _NOEXCEPT {return atan((double)__x);}
723 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
724 inline _LIBCPP_INLINE_VISIBILITY float atan2(float __y, float __x) _NOEXCEPT {return atan2f(__y, __x);}
725 inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) _NOEXCEPT {return atan2l(__y, __x);}
728 template <class _A1, class _A2>
729 inline _LIBCPP_INLINE_VISIBILITY
732 is_arithmetic<_A1>::value &&
733 is_arithmetic<_A2>::value,
734 typename __promote<_A1, _A2>::type
736 atan2(_A1 __y, _A2 __x) _NOEXCEPT
738 typedef typename __promote<_A1, _A2>::type __result_type;
739 static_assert((!(is_same<_A1, __result_type>::value &&
740 is_same<_A2, __result_type>::value)), "");
741 return atan2((__result_type)__y, (__result_type)__x);
749 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
750 inline _LIBCPP_INLINE_VISIBILITY float ceil(float __x) _NOEXCEPT {return ceilf(__x);}
751 inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) _NOEXCEPT {return ceill(__x);}
755 inline _LIBCPP_INLINE_VISIBILITY
756 typename enable_if<is_integral<_A1>::value, double>::type
757 ceil(_A1 __x) _NOEXCEPT {return ceil((double)__x);}
764 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
765 inline _LIBCPP_INLINE_VISIBILITY float cos(float __x) _NOEXCEPT {return cosf(__x);}
766 inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) _NOEXCEPT {return cosl(__x);}
770 inline _LIBCPP_INLINE_VISIBILITY
771 typename enable_if<is_integral<_A1>::value, double>::type
772 cos(_A1 __x) _NOEXCEPT {return cos((double)__x);}
779 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
780 inline _LIBCPP_INLINE_VISIBILITY float cosh(float __x) _NOEXCEPT {return coshf(__x);}
781 inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) _NOEXCEPT {return coshl(__x);}
785 inline _LIBCPP_INLINE_VISIBILITY
786 typename enable_if<is_integral<_A1>::value, double>::type
787 cosh(_A1 __x) _NOEXCEPT {return cosh((double)__x);}
797 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
798 inline _LIBCPP_INLINE_VISIBILITY float exp(float __x) _NOEXCEPT {return expf(__x);}
799 inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) _NOEXCEPT {return expl(__x);}
804 inline _LIBCPP_INLINE_VISIBILITY
805 typename enable_if<is_integral<_A1>::value, double>::type
806 exp(_A1 __x) _NOEXCEPT {return exp((double)__x);}
813 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
814 inline _LIBCPP_INLINE_VISIBILITY float fabs(float __x) _NOEXCEPT {return fabsf(__x);}
815 inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) _NOEXCEPT {return fabsl(__x);}
819 inline _LIBCPP_INLINE_VISIBILITY
820 typename enable_if<is_integral<_A1>::value, double>::type
821 fabs(_A1 __x) _NOEXCEPT {return fabs((double)__x);}
828 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
829 inline _LIBCPP_INLINE_VISIBILITY float floor(float __x) _NOEXCEPT {return floorf(__x);}
830 inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) _NOEXCEPT {return floorl(__x);}
834 inline _LIBCPP_INLINE_VISIBILITY
835 typename enable_if<is_integral<_A1>::value, double>::type
836 floor(_A1 __x) _NOEXCEPT {return floor((double)__x);}
845 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
846 inline _LIBCPP_INLINE_VISIBILITY float fmod(float __x, float __y) _NOEXCEPT {return fmodf(__x, __y);}
847 inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) _NOEXCEPT {return fmodl(__x, __y);}
850 template <class _A1, class _A2>
851 inline _LIBCPP_INLINE_VISIBILITY
854 is_arithmetic<_A1>::value &&
855 is_arithmetic<_A2>::value,
856 typename __promote<_A1, _A2>::type
858 fmod(_A1 __x, _A2 __y) _NOEXCEPT
860 typedef typename __promote<_A1, _A2>::type __result_type;
861 static_assert((!(is_same<_A1, __result_type>::value &&
862 is_same<_A2, __result_type>::value)), "");
863 return fmod((__result_type)__x, (__result_type)__y);
872 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
873 inline _LIBCPP_INLINE_VISIBILITY float frexp(float __x, int* __e) _NOEXCEPT {return frexpf(__x, __e);}
874 inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) _NOEXCEPT {return frexpl(__x, __e);}
878 inline _LIBCPP_INLINE_VISIBILITY
879 typename enable_if<is_integral<_A1>::value, double>::type
880 frexp(_A1 __x, int* __e) _NOEXCEPT {return frexp((double)__x, __e);}
887 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
888 inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __x, int __e) _NOEXCEPT {return ldexpf(__x, __e);}
889 inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) _NOEXCEPT {return ldexpl(__x, __e);}
893 inline _LIBCPP_INLINE_VISIBILITY
894 typename enable_if<is_integral<_A1>::value, double>::type
895 ldexp(_A1 __x, int __e) _NOEXCEPT {return ldexp((double)__x, __e);}
904 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
905 inline _LIBCPP_INLINE_VISIBILITY float log(float __x) _NOEXCEPT {return logf(__x);}
906 inline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) _NOEXCEPT {return logl(__x);}
910 inline _LIBCPP_INLINE_VISIBILITY
911 typename enable_if<is_integral<_A1>::value, double>::type
912 log(_A1 __x) _NOEXCEPT {return log((double)__x);}
920 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
921 inline _LIBCPP_INLINE_VISIBILITY float log10(float __x) _NOEXCEPT {return log10f(__x);}
922 inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) _NOEXCEPT {return log10l(__x);}
926 inline _LIBCPP_INLINE_VISIBILITY
927 typename enable_if<is_integral<_A1>::value, double>::type
928 log10(_A1 __x) _NOEXCEPT {return log10((double)__x);}
935 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
936 inline _LIBCPP_INLINE_VISIBILITY float modf(float __x, float* __y) _NOEXCEPT {return modff(__x, __y);}
937 inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) _NOEXCEPT {return modfl(__x, __y);}
948 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
949 inline _LIBCPP_INLINE_VISIBILITY float pow(float __x, float __y) _NOEXCEPT {return powf(__x, __y);}
950 inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) _NOEXCEPT {return powl(__x, __y);}
953 template <class _A1, class _A2>
954 inline _LIBCPP_INLINE_VISIBILITY
957 is_arithmetic<_A1>::value &&
958 is_arithmetic<_A2>::value,
959 typename __promote<_A1, _A2>::type
961 pow(_A1 __x, _A2 __y) _NOEXCEPT
963 typedef typename __promote<_A1, _A2>::type __result_type;
964 static_assert((!(is_same<_A1, __result_type>::value &&
965 is_same<_A2, __result_type>::value)), "");
966 return pow((__result_type)__x, (__result_type)__y);
975 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
976 inline _LIBCPP_INLINE_VISIBILITY float sin(float __x) _NOEXCEPT {return sinf(__x);}
977 inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) _NOEXCEPT {return sinl(__x);}
981 inline _LIBCPP_INLINE_VISIBILITY
982 typename enable_if<is_integral<_A1>::value, double>::type
983 sin(_A1 __x) _NOEXCEPT {return sin((double)__x);}
990 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
991 inline _LIBCPP_INLINE_VISIBILITY float sinh(float __x) _NOEXCEPT {return sinhf(__x);}
992 inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) _NOEXCEPT {return sinhl(__x);}
996 inline _LIBCPP_INLINE_VISIBILITY
997 typename enable_if<is_integral<_A1>::value, double>::type
998 sinh(_A1 __x) _NOEXCEPT {return sinh((double)__x);}
1007 #if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX))
1008 inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __x) _NOEXCEPT {return sqrtf(__x);}
1009 inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) _NOEXCEPT {return sqrtl(__x);}
1012 template <class _A1>
1013 inline _LIBCPP_INLINE_VISIBILITY
1014 typename enable_if<is_integral<_A1>::value, double>::type
1015 sqrt(_A1 __x) _NOEXCEPT {return sqrt((double)__x);}
1023 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
1024 inline _LIBCPP_INLINE_VISIBILITY float tan(float __x) _NOEXCEPT {return tanf(__x);}
1025 inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) _NOEXCEPT {return tanl(__x);}
1028 template <class _A1>
1029 inline _LIBCPP_INLINE_VISIBILITY
1030 typename enable_if<is_integral<_A1>::value, double>::type
1031 tan(_A1 __x) _NOEXCEPT {return tan((double)__x);}
1038 #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
1039 inline _LIBCPP_INLINE_VISIBILITY float tanh(float __x) _NOEXCEPT {return tanhf(__x);}
1040 inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) _NOEXCEPT {return tanhl(__x);}
1043 template <class _A1>
1044 inline _LIBCPP_INLINE_VISIBILITY
1045 typename enable_if<is_integral<_A1>::value, double>::type
1046 tanh(_A1 __x) _NOEXCEPT {return tanh((double)__x);}
1050 #ifndef _LIBCPP_MSVCRT
1054 inline _LIBCPP_INLINE_VISIBILITY float acosh(float __x) _NOEXCEPT {return acoshf(__x);}
1055 inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) _NOEXCEPT {return acoshl(__x);}
1057 template <class _A1>
1058 inline _LIBCPP_INLINE_VISIBILITY
1059 typename enable_if<is_integral<_A1>::value, double>::type
1060 acosh(_A1 __x) _NOEXCEPT {return acosh((double)__x);}
1065 #ifndef _LIBCPP_MSVCRT
1069 inline _LIBCPP_INLINE_VISIBILITY float asinh(float __x) _NOEXCEPT {return asinhf(__x);}
1070 inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) _NOEXCEPT {return asinhl(__x);}
1072 template <class _A1>
1073 inline _LIBCPP_INLINE_VISIBILITY
1074 typename enable_if<is_integral<_A1>::value, double>::type
1075 asinh(_A1 __x) _NOEXCEPT {return asinh((double)__x);}
1080 #ifndef _LIBCPP_MSVCRT
1084 inline _LIBCPP_INLINE_VISIBILITY float atanh(float __x) _NOEXCEPT {return atanhf(__x);}
1085 inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) _NOEXCEPT {return atanhl(__x);}
1087 template <class _A1>
1088 inline _LIBCPP_INLINE_VISIBILITY
1089 typename enable_if<is_integral<_A1>::value, double>::type
1090 atanh(_A1 __x) _NOEXCEPT {return atanh((double)__x);}
1095 #ifndef _LIBCPP_MSVCRT
1099 inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __x) _NOEXCEPT {return cbrtf(__x);}
1100 inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) _NOEXCEPT {return cbrtl(__x);}
1102 template <class _A1>
1103 inline _LIBCPP_INLINE_VISIBILITY
1104 typename enable_if<is_integral<_A1>::value, double>::type
1105 cbrt(_A1 __x) _NOEXCEPT {return cbrt((double)__x);}
1113 inline _LIBCPP_INLINE_VISIBILITY float copysign(float __x, float __y) _NOEXCEPT {return copysignf(__x, __y);}
1114 inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) _NOEXCEPT {return copysignl(__x, __y);}
1116 template <class _A1, class _A2>
1117 inline _LIBCPP_INLINE_VISIBILITY
1120 is_arithmetic<_A1>::value &&
1121 is_arithmetic<_A2>::value,
1122 typename __promote<_A1, _A2>::type
1124 copysign(_A1 __x, _A2 __y) _NOEXCEPT
1126 typedef typename __promote<_A1, _A2>::type __result_type;
1127 static_assert((!(is_same<_A1, __result_type>::value &&
1128 is_same<_A2, __result_type>::value)), "");
1129 return copysign((__result_type)__x, (__result_type)__y);
1132 #ifndef _LIBCPP_MSVCRT
1139 inline _LIBCPP_INLINE_VISIBILITY float erf(float __x) _NOEXCEPT {return erff(__x);}
1140 inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) _NOEXCEPT {return erfl(__x);}
1142 template <class _A1>
1143 inline _LIBCPP_INLINE_VISIBILITY
1144 typename enable_if<is_integral<_A1>::value, double>::type
1145 erf(_A1 __x) _NOEXCEPT {return erf((double)__x);}
1152 inline _LIBCPP_INLINE_VISIBILITY float erfc(float __x) _NOEXCEPT {return erfcf(__x);}
1153 inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) _NOEXCEPT {return erfcl(__x);}
1155 template <class _A1>
1156 inline _LIBCPP_INLINE_VISIBILITY
1157 typename enable_if<is_integral<_A1>::value, double>::type
1158 erfc(_A1 __x) _NOEXCEPT {return erfc((double)__x);}
1165 inline _LIBCPP_INLINE_VISIBILITY float exp2(float __x) _NOEXCEPT {return exp2f(__x);}
1166 inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) _NOEXCEPT {return exp2l(__x);}
1168 template <class _A1>
1169 inline _LIBCPP_INLINE_VISIBILITY
1170 typename enable_if<is_integral<_A1>::value, double>::type
1171 exp2(_A1 __x) _NOEXCEPT {return exp2((double)__x);}
1178 inline _LIBCPP_INLINE_VISIBILITY float expm1(float __x) _NOEXCEPT {return expm1f(__x);}
1179 inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) _NOEXCEPT {return expm1l(__x);}
1181 template <class _A1>
1182 inline _LIBCPP_INLINE_VISIBILITY
1183 typename enable_if<is_integral<_A1>::value, double>::type
1184 expm1(_A1 __x) _NOEXCEPT {return expm1((double)__x);}
1191 inline _LIBCPP_INLINE_VISIBILITY float fdim(float __x, float __y) _NOEXCEPT {return fdimf(__x, __y);}
1192 inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) _NOEXCEPT {return fdiml(__x, __y);}
1194 template <class _A1, class _A2>
1195 inline _LIBCPP_INLINE_VISIBILITY
1198 is_arithmetic<_A1>::value &&
1199 is_arithmetic<_A2>::value,
1200 typename __promote<_A1, _A2>::type
1202 fdim(_A1 __x, _A2 __y) _NOEXCEPT
1204 typedef typename __promote<_A1, _A2>::type __result_type;
1205 static_assert((!(is_same<_A1, __result_type>::value &&
1206 is_same<_A2, __result_type>::value)), "");
1207 return fdim((__result_type)__x, (__result_type)__y);
1212 inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) _NOEXCEPT {return (float)((double)__x*__y + __z);}
1213 #ifndef FP_FAST_FMAF
1214 #define FP_FAST_FMAF
1219 inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) _NOEXCEPT {return fmaf(__x, __y, __z);}
1220 inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) _NOEXCEPT {return fmal(__x, __y, __z);}
1222 template <class _A1, class _A2, class _A3>
1223 inline _LIBCPP_INLINE_VISIBILITY
1226 is_arithmetic<_A1>::value &&
1227 is_arithmetic<_A2>::value &&
1228 is_arithmetic<_A3>::value,
1229 typename __promote<_A1, _A2, _A3>::type
1231 fma(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT
1233 typedef typename __promote<_A1, _A2, _A3>::type __result_type;
1234 static_assert((!(is_same<_A1, __result_type>::value &&
1235 is_same<_A2, __result_type>::value &&
1236 is_same<_A3, __result_type>::value)), "");
1237 return fma((__result_type)__x, (__result_type)__y, (__result_type)__z);
1245 inline _LIBCPP_INLINE_VISIBILITY float fmax(float __x, float __y) _NOEXCEPT {return fmaxf(__x, __y);}
1246 inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) _NOEXCEPT {return fmaxl(__x, __y);}
1248 template <class _A1, class _A2>
1249 inline _LIBCPP_INLINE_VISIBILITY
1252 is_arithmetic<_A1>::value &&
1253 is_arithmetic<_A2>::value,
1254 typename __promote<_A1, _A2>::type
1256 fmax(_A1 __x, _A2 __y) _NOEXCEPT
1258 typedef typename __promote<_A1, _A2>::type __result_type;
1259 static_assert((!(is_same<_A1, __result_type>::value &&
1260 is_same<_A2, __result_type>::value)), "");
1261 return fmax((__result_type)__x, (__result_type)__y);
1269 inline _LIBCPP_INLINE_VISIBILITY float fmin(float __x, float __y) _NOEXCEPT {return fminf(__x, __y);}
1270 inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) _NOEXCEPT {return fminl(__x, __y);}
1272 template <class _A1, class _A2>
1273 inline _LIBCPP_INLINE_VISIBILITY
1276 is_arithmetic<_A1>::value &&
1277 is_arithmetic<_A2>::value,
1278 typename __promote<_A1, _A2>::type
1280 fmin(_A1 __x, _A2 __y) _NOEXCEPT
1282 typedef typename __promote<_A1, _A2>::type __result_type;
1283 static_assert((!(is_same<_A1, __result_type>::value &&
1284 is_same<_A2, __result_type>::value)), "");
1285 return fmin((__result_type)__x, (__result_type)__y);
1293 inline _LIBCPP_INLINE_VISIBILITY float hypot(float __x, float __y) _NOEXCEPT {return hypotf(__x, __y);}
1294 inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) _NOEXCEPT {return hypotl(__x, __y);}
1296 template <class _A1, class _A2>
1297 inline _LIBCPP_INLINE_VISIBILITY
1300 is_arithmetic<_A1>::value &&
1301 is_arithmetic<_A2>::value,
1302 typename __promote<_A1, _A2>::type
1304 hypot(_A1 __x, _A2 __y) _NOEXCEPT
1306 typedef typename __promote<_A1, _A2>::type __result_type;
1307 static_assert((!(is_same<_A1, __result_type>::value &&
1308 is_same<_A2, __result_type>::value)), "");
1309 return hypot((__result_type)__x, (__result_type)__y);
1317 inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x) _NOEXCEPT {return ilogbf(__x);}
1318 inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) _NOEXCEPT {return ilogbl(__x);}
1320 template <class _A1>
1321 inline _LIBCPP_INLINE_VISIBILITY
1322 typename enable_if<is_integral<_A1>::value, int>::type
1323 ilogb(_A1 __x) _NOEXCEPT {return ilogb((double)__x);}
1330 inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __x) _NOEXCEPT {return lgammaf(__x);}
1331 inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) _NOEXCEPT {return lgammal(__x);}
1334 template <class _A1>
1335 inline _LIBCPP_INLINE_VISIBILITY
1336 typename enable_if<is_integral<_A1>::value, double>::type
1337 lgamma(_A1 __x) _NOEXCEPT {return lgamma((double)__x);}
1345 inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) _NOEXCEPT {return llrintf(__x);}
1346 inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) _NOEXCEPT {return llrintl(__x);}
1348 template <class _A1>
1349 inline _LIBCPP_INLINE_VISIBILITY
1350 typename enable_if<is_integral<_A1>::value, long long>::type
1351 llrint(_A1 __x) _NOEXCEPT {return llrint((double)__x);}
1358 inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) _NOEXCEPT {return llroundf(__x);}
1359 inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) _NOEXCEPT {return llroundl(__x);}
1361 template <class _A1>
1362 inline _LIBCPP_INLINE_VISIBILITY
1363 typename enable_if<is_integral<_A1>::value, long long>::type
1364 llround(_A1 __x) _NOEXCEPT {return llround((double)__x);}
1371 inline _LIBCPP_INLINE_VISIBILITY float log1p(float __x) _NOEXCEPT {return log1pf(__x);}
1372 inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) _NOEXCEPT {return log1pl(__x);}
1374 template <class _A1>
1375 inline _LIBCPP_INLINE_VISIBILITY
1376 typename enable_if<is_integral<_A1>::value, double>::type
1377 log1p(_A1 __x) _NOEXCEPT {return log1p((double)__x);}
1384 inline _LIBCPP_INLINE_VISIBILITY float log2(float __x) _NOEXCEPT {return log2f(__x);}
1385 inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) _NOEXCEPT {return log2l(__x);}
1387 template <class _A1>
1388 inline _LIBCPP_INLINE_VISIBILITY
1389 typename enable_if<is_integral<_A1>::value, double>::type
1390 log2(_A1 __x) _NOEXCEPT {return log2((double)__x);}
1397 inline _LIBCPP_INLINE_VISIBILITY float logb(float __x) _NOEXCEPT {return logbf(__x);}
1398 inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) _NOEXCEPT {return logbl(__x);}
1400 template <class _A1>
1401 inline _LIBCPP_INLINE_VISIBILITY
1402 typename enable_if<is_integral<_A1>::value, double>::type
1403 logb(_A1 __x) _NOEXCEPT {return logb((double)__x);}
1410 inline _LIBCPP_INLINE_VISIBILITY long lrint(float __x) _NOEXCEPT {return lrintf(__x);}
1411 inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) _NOEXCEPT {return lrintl(__x);}
1413 template <class _A1>
1414 inline _LIBCPP_INLINE_VISIBILITY
1415 typename enable_if<is_integral<_A1>::value, long>::type
1416 lrint(_A1 __x) _NOEXCEPT {return lrint((double)__x);}
1423 inline _LIBCPP_INLINE_VISIBILITY long lround(float __x) _NOEXCEPT {return lroundf(__x);}
1424 inline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) _NOEXCEPT {return lroundl(__x);}
1426 template <class _A1>
1427 inline _LIBCPP_INLINE_VISIBILITY
1428 typename enable_if<is_integral<_A1>::value, long>::type
1429 lround(_A1 __x) _NOEXCEPT {return lround((double)__x);}
1431 #endif // _LIBCPP_MSVCRT
1436 #ifndef _LIBCPP_MSVCRT
1439 #endif // _LIBCPP_MSVCRT
1442 #ifndef _LIBCPP_MSVCRT
1449 inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __x) _NOEXCEPT {return nearbyintf(__x);}
1450 inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) _NOEXCEPT {return nearbyintl(__x);}
1452 template <class _A1>
1453 inline _LIBCPP_INLINE_VISIBILITY
1454 typename enable_if<is_integral<_A1>::value, double>::type
1455 nearbyint(_A1 __x) _NOEXCEPT {return nearbyint((double)__x);}
1462 inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __x, float __y) _NOEXCEPT {return nextafterf(__x, __y);}
1463 inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) _NOEXCEPT {return nextafterl(__x, __y);}
1465 template <class _A1, class _A2>
1466 inline _LIBCPP_INLINE_VISIBILITY
1469 is_arithmetic<_A1>::value &&
1470 is_arithmetic<_A2>::value,
1471 typename __promote<_A1, _A2>::type
1473 nextafter(_A1 __x, _A2 __y) _NOEXCEPT
1475 typedef typename __promote<_A1, _A2>::type __result_type;
1476 static_assert((!(is_same<_A1, __result_type>::value &&
1477 is_same<_A2, __result_type>::value)), "");
1478 return nextafter((__result_type)__x, (__result_type)__y);
1484 using ::nexttowardf;
1486 inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __x, long double __y) _NOEXCEPT {return nexttowardf(__x, __y);}
1487 inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) _NOEXCEPT {return nexttowardl(__x, __y);}
1489 template <class _A1>
1490 inline _LIBCPP_INLINE_VISIBILITY
1491 typename enable_if<is_integral<_A1>::value, double>::type
1492 nexttoward(_A1 __x, long double __y) _NOEXCEPT {return nexttoward((double)__x, __y);}
1499 inline _LIBCPP_INLINE_VISIBILITY float remainder(float __x, float __y) _NOEXCEPT {return remainderf(__x, __y);}
1500 inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) _NOEXCEPT {return remainderl(__x, __y);}
1502 template <class _A1, class _A2>
1503 inline _LIBCPP_INLINE_VISIBILITY
1506 is_arithmetic<_A1>::value &&
1507 is_arithmetic<_A2>::value,
1508 typename __promote<_A1, _A2>::type
1510 remainder(_A1 __x, _A2 __y) _NOEXCEPT
1512 typedef typename __promote<_A1, _A2>::type __result_type;
1513 static_assert((!(is_same<_A1, __result_type>::value &&
1514 is_same<_A2, __result_type>::value)), "");
1515 return remainder((__result_type)__x, (__result_type)__y);
1523 inline _LIBCPP_INLINE_VISIBILITY float remquo(float __x, float __y, int* __z) _NOEXCEPT {return remquof(__x, __y, __z);}
1524 inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) _NOEXCEPT {return remquol(__x, __y, __z);}
1526 template <class _A1, class _A2>
1527 inline _LIBCPP_INLINE_VISIBILITY
1530 is_arithmetic<_A1>::value &&
1531 is_arithmetic<_A2>::value,
1532 typename __promote<_A1, _A2>::type
1534 remquo(_A1 __x, _A2 __y, int* __z) _NOEXCEPT
1536 typedef typename __promote<_A1, _A2>::type __result_type;
1537 static_assert((!(is_same<_A1, __result_type>::value &&
1538 is_same<_A2, __result_type>::value)), "");
1539 return remquo((__result_type)__x, (__result_type)__y, __z);
1547 inline _LIBCPP_INLINE_VISIBILITY float rint(float __x) _NOEXCEPT {return rintf(__x);}
1548 inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) _NOEXCEPT {return rintl(__x);}
1550 template <class _A1>
1551 inline _LIBCPP_INLINE_VISIBILITY
1552 typename enable_if<is_integral<_A1>::value, double>::type
1553 rint(_A1 __x) _NOEXCEPT {return rint((double)__x);}
1560 inline _LIBCPP_INLINE_VISIBILITY float round(float __x) _NOEXCEPT {return roundf(__x);}
1561 inline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) _NOEXCEPT {return roundl(__x);}
1563 template <class _A1>
1564 inline _LIBCPP_INLINE_VISIBILITY
1565 typename enable_if<is_integral<_A1>::value, double>::type
1566 round(_A1 __x) _NOEXCEPT {return round((double)__x);}
1573 inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __x, long __y) _NOEXCEPT {return scalblnf(__x, __y);}
1574 inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) _NOEXCEPT {return scalblnl(__x, __y);}
1576 template <class _A1>
1577 inline _LIBCPP_INLINE_VISIBILITY
1578 typename enable_if<is_integral<_A1>::value, double>::type
1579 scalbln(_A1 __x, long __y) _NOEXCEPT {return scalbln((double)__x, __y);}
1586 inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) _NOEXCEPT {return scalbnf(__x, __y);}
1587 inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) _NOEXCEPT {return scalbnl(__x, __y);}
1589 template <class _A1>
1590 inline _LIBCPP_INLINE_VISIBILITY
1591 typename enable_if<is_integral<_A1>::value, double>::type
1592 scalbn(_A1 __x, int __y) _NOEXCEPT {return scalbn((double)__x, __y);}
1599 inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __x) _NOEXCEPT {return tgammaf(__x);}
1600 inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) _NOEXCEPT {return tgammal(__x);}
1602 template <class _A1>
1603 inline _LIBCPP_INLINE_VISIBILITY
1604 typename enable_if<is_integral<_A1>::value, double>::type
1605 tgamma(_A1 __x) _NOEXCEPT {return tgamma((double)__x);}
1612 inline _LIBCPP_INLINE_VISIBILITY float trunc(float __x) _NOEXCEPT {return truncf(__x);}
1613 inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) _NOEXCEPT {return truncl(__x);}
1615 template <class _A1>
1616 inline _LIBCPP_INLINE_VISIBILITY
1617 typename enable_if<is_integral<_A1>::value, double>::type
1618 trunc(_A1 __x) _NOEXCEPT {return trunc((double)__x);}
1620 #endif // !_LIBCPP_MSVCRT
1643 #ifndef _LIBCPP_MSVCRT
1649 #endif // !_LIBCPP_MSVCRT
1651 #ifndef _LIBCPP_MSVCRT
1673 using ::nexttowardl;
1682 #endif // !_LIBCPP_MSVCRT
1688 _LIBCPP_END_NAMESPACE_STD
1690 #endif // _LIBCPP_CMATH