xref: /freebsd-12.1/contrib/libc++/include/math.h (revision 4ba319b5)
19729cf09SDimitry Andric // -*- C++ -*-
29729cf09SDimitry Andric //===---------------------------- math.h ----------------------------------===//
39729cf09SDimitry Andric //
49729cf09SDimitry Andric //                     The LLVM Compiler Infrastructure
59729cf09SDimitry Andric //
69729cf09SDimitry Andric // This file is dual licensed under the MIT and the University of Illinois Open
79729cf09SDimitry Andric // Source Licenses. See LICENSE.TXT for details.
89729cf09SDimitry Andric //
99729cf09SDimitry Andric //===----------------------------------------------------------------------===//
109729cf09SDimitry Andric 
119729cf09SDimitry Andric #ifndef _LIBCPP_MATH_H
129729cf09SDimitry Andric #define _LIBCPP_MATH_H
139729cf09SDimitry Andric 
149729cf09SDimitry Andric /*
159729cf09SDimitry Andric     math.h synopsis
169729cf09SDimitry Andric 
179729cf09SDimitry Andric Macros:
189729cf09SDimitry Andric 
199729cf09SDimitry Andric     HUGE_VAL
209729cf09SDimitry Andric     HUGE_VALF               // C99
219729cf09SDimitry Andric     HUGE_VALL               // C99
229729cf09SDimitry Andric     INFINITY                // C99
239729cf09SDimitry Andric     NAN                     // C99
249729cf09SDimitry Andric     FP_INFINITE             // C99
259729cf09SDimitry Andric     FP_NAN                  // C99
269729cf09SDimitry Andric     FP_NORMAL               // C99
279729cf09SDimitry Andric     FP_SUBNORMAL            // C99
289729cf09SDimitry Andric     FP_ZERO                 // C99
299729cf09SDimitry Andric     FP_FAST_FMA             // C99
309729cf09SDimitry Andric     FP_FAST_FMAF            // C99
319729cf09SDimitry Andric     FP_FAST_FMAL            // C99
329729cf09SDimitry Andric     FP_ILOGB0               // C99
339729cf09SDimitry Andric     FP_ILOGBNAN             // C99
349729cf09SDimitry Andric     MATH_ERRNO              // C99
359729cf09SDimitry Andric     MATH_ERREXCEPT          // C99
369729cf09SDimitry Andric     math_errhandling        // C99
379729cf09SDimitry Andric 
389729cf09SDimitry Andric Types:
399729cf09SDimitry Andric 
409729cf09SDimitry Andric     float_t                 // C99
419729cf09SDimitry Andric     double_t                // C99
429729cf09SDimitry Andric 
439729cf09SDimitry Andric // C90
449729cf09SDimitry Andric 
459729cf09SDimitry Andric floating_point abs(floating_point x);
469729cf09SDimitry Andric 
479729cf09SDimitry Andric floating_point acos (arithmetic x);
489729cf09SDimitry Andric float          acosf(float x);
499729cf09SDimitry Andric long double    acosl(long double x);
509729cf09SDimitry Andric 
519729cf09SDimitry Andric floating_point asin (arithmetic x);
529729cf09SDimitry Andric float          asinf(float x);
539729cf09SDimitry Andric long double    asinl(long double x);
549729cf09SDimitry Andric 
559729cf09SDimitry Andric floating_point atan (arithmetic x);
569729cf09SDimitry Andric float          atanf(float x);
579729cf09SDimitry Andric long double    atanl(long double x);
589729cf09SDimitry Andric 
599729cf09SDimitry Andric floating_point atan2 (arithmetic y, arithmetic x);
609729cf09SDimitry Andric float          atan2f(float y, float x);
619729cf09SDimitry Andric long double    atan2l(long double y, long double x);
629729cf09SDimitry Andric 
639729cf09SDimitry Andric floating_point ceil (arithmetic x);
649729cf09SDimitry Andric float          ceilf(float x);
659729cf09SDimitry Andric long double    ceill(long double x);
669729cf09SDimitry Andric 
679729cf09SDimitry Andric floating_point cos (arithmetic x);
689729cf09SDimitry Andric float          cosf(float x);
699729cf09SDimitry Andric long double    cosl(long double x);
709729cf09SDimitry Andric 
719729cf09SDimitry Andric floating_point cosh (arithmetic x);
729729cf09SDimitry Andric float          coshf(float x);
739729cf09SDimitry Andric long double    coshl(long double x);
749729cf09SDimitry Andric 
759729cf09SDimitry Andric floating_point exp (arithmetic x);
769729cf09SDimitry Andric float          expf(float x);
779729cf09SDimitry Andric long double    expl(long double x);
789729cf09SDimitry Andric 
799729cf09SDimitry Andric floating_point fabs (arithmetic x);
809729cf09SDimitry Andric float          fabsf(float x);
819729cf09SDimitry Andric long double    fabsl(long double x);
829729cf09SDimitry Andric 
839729cf09SDimitry Andric floating_point floor (arithmetic x);
849729cf09SDimitry Andric float          floorf(float x);
859729cf09SDimitry Andric long double    floorl(long double x);
869729cf09SDimitry Andric 
879729cf09SDimitry Andric floating_point fmod (arithmetic x, arithmetic y);
889729cf09SDimitry Andric float          fmodf(float x, float y);
899729cf09SDimitry Andric long double    fmodl(long double x, long double y);
909729cf09SDimitry Andric 
919729cf09SDimitry Andric floating_point frexp (arithmetic value, int* exp);
929729cf09SDimitry Andric float          frexpf(float value, int* exp);
939729cf09SDimitry Andric long double    frexpl(long double value, int* exp);
949729cf09SDimitry Andric 
959729cf09SDimitry Andric floating_point ldexp (arithmetic value, int exp);
969729cf09SDimitry Andric float          ldexpf(float value, int exp);
979729cf09SDimitry Andric long double    ldexpl(long double value, int exp);
989729cf09SDimitry Andric 
999729cf09SDimitry Andric floating_point log (arithmetic x);
1009729cf09SDimitry Andric float          logf(float x);
1019729cf09SDimitry Andric long double    logl(long double x);
1029729cf09SDimitry Andric 
1039729cf09SDimitry Andric floating_point log10 (arithmetic x);
1049729cf09SDimitry Andric float          log10f(float x);
1059729cf09SDimitry Andric long double    log10l(long double x);
1069729cf09SDimitry Andric 
1079729cf09SDimitry Andric floating_point modf (floating_point value, floating_point* iptr);
1089729cf09SDimitry Andric float          modff(float value, float* iptr);
1099729cf09SDimitry Andric long double    modfl(long double value, long double* iptr);
1109729cf09SDimitry Andric 
1119729cf09SDimitry Andric floating_point pow (arithmetic x, arithmetic y);
1129729cf09SDimitry Andric float          powf(float x, float y);
1139729cf09SDimitry Andric long double    powl(long double x, long double y);
1149729cf09SDimitry Andric 
1159729cf09SDimitry Andric floating_point sin (arithmetic x);
1169729cf09SDimitry Andric float          sinf(float x);
1179729cf09SDimitry Andric long double    sinl(long double x);
1189729cf09SDimitry Andric 
1199729cf09SDimitry Andric floating_point sinh (arithmetic x);
1209729cf09SDimitry Andric float          sinhf(float x);
1219729cf09SDimitry Andric long double    sinhl(long double x);
1229729cf09SDimitry Andric 
1239729cf09SDimitry Andric floating_point sqrt (arithmetic x);
1249729cf09SDimitry Andric float          sqrtf(float x);
1259729cf09SDimitry Andric long double    sqrtl(long double x);
1269729cf09SDimitry Andric 
1279729cf09SDimitry Andric floating_point tan (arithmetic x);
1289729cf09SDimitry Andric float          tanf(float x);
1299729cf09SDimitry Andric long double    tanl(long double x);
1309729cf09SDimitry Andric 
1319729cf09SDimitry Andric floating_point tanh (arithmetic x);
1329729cf09SDimitry Andric float          tanhf(float x);
1339729cf09SDimitry Andric long double    tanhl(long double x);
1349729cf09SDimitry Andric 
1359729cf09SDimitry Andric //  C99
1369729cf09SDimitry Andric 
1379729cf09SDimitry Andric bool signbit(arithmetic x);
1389729cf09SDimitry Andric 
1399729cf09SDimitry Andric int fpclassify(arithmetic x);
1409729cf09SDimitry Andric 
1419729cf09SDimitry Andric bool isfinite(arithmetic x);
1429729cf09SDimitry Andric bool isinf(arithmetic x);
1439729cf09SDimitry Andric bool isnan(arithmetic x);
1449729cf09SDimitry Andric bool isnormal(arithmetic x);
1459729cf09SDimitry Andric 
1469729cf09SDimitry Andric bool isgreater(arithmetic x, arithmetic y);
1479729cf09SDimitry Andric bool isgreaterequal(arithmetic x, arithmetic y);
1489729cf09SDimitry Andric bool isless(arithmetic x, arithmetic y);
1499729cf09SDimitry Andric bool islessequal(arithmetic x, arithmetic y);
1509729cf09SDimitry Andric bool islessgreater(arithmetic x, arithmetic y);
1519729cf09SDimitry Andric bool isunordered(arithmetic x, arithmetic y);
1529729cf09SDimitry Andric 
1539729cf09SDimitry Andric floating_point acosh (arithmetic x);
1549729cf09SDimitry Andric float          acoshf(float x);
1559729cf09SDimitry Andric long double    acoshl(long double x);
1569729cf09SDimitry Andric 
1579729cf09SDimitry Andric floating_point asinh (arithmetic x);
1589729cf09SDimitry Andric float          asinhf(float x);
1599729cf09SDimitry Andric long double    asinhl(long double x);
1609729cf09SDimitry Andric 
1619729cf09SDimitry Andric floating_point atanh (arithmetic x);
1629729cf09SDimitry Andric float          atanhf(float x);
1639729cf09SDimitry Andric long double    atanhl(long double x);
1649729cf09SDimitry Andric 
1659729cf09SDimitry Andric floating_point cbrt (arithmetic x);
1669729cf09SDimitry Andric float          cbrtf(float x);
1679729cf09SDimitry Andric long double    cbrtl(long double x);
1689729cf09SDimitry Andric 
1699729cf09SDimitry Andric floating_point copysign (arithmetic x, arithmetic y);
1709729cf09SDimitry Andric float          copysignf(float x, float y);
1719729cf09SDimitry Andric long double    copysignl(long double x, long double y);
1729729cf09SDimitry Andric 
1739729cf09SDimitry Andric floating_point erf (arithmetic x);
1749729cf09SDimitry Andric float          erff(float x);
1759729cf09SDimitry Andric long double    erfl(long double x);
1769729cf09SDimitry Andric 
1779729cf09SDimitry Andric floating_point erfc (arithmetic x);
1789729cf09SDimitry Andric float          erfcf(float x);
1799729cf09SDimitry Andric long double    erfcl(long double x);
1809729cf09SDimitry Andric 
1819729cf09SDimitry Andric floating_point exp2 (arithmetic x);
1829729cf09SDimitry Andric float          exp2f(float x);
1839729cf09SDimitry Andric long double    exp2l(long double x);
1849729cf09SDimitry Andric 
1859729cf09SDimitry Andric floating_point expm1 (arithmetic x);
1869729cf09SDimitry Andric float          expm1f(float x);
1879729cf09SDimitry Andric long double    expm1l(long double x);
1889729cf09SDimitry Andric 
1899729cf09SDimitry Andric floating_point fdim (arithmetic x, arithmetic y);
1909729cf09SDimitry Andric float          fdimf(float x, float y);
1919729cf09SDimitry Andric long double    fdiml(long double x, long double y);
1929729cf09SDimitry Andric 
1939729cf09SDimitry Andric floating_point fma (arithmetic x, arithmetic y, arithmetic z);
1949729cf09SDimitry Andric float          fmaf(float x, float y, float z);
1959729cf09SDimitry Andric long double    fmal(long double x, long double y, long double z);
1969729cf09SDimitry Andric 
1979729cf09SDimitry Andric floating_point fmax (arithmetic x, arithmetic y);
1989729cf09SDimitry Andric float          fmaxf(float x, float y);
1999729cf09SDimitry Andric long double    fmaxl(long double x, long double y);
2009729cf09SDimitry Andric 
2019729cf09SDimitry Andric floating_point fmin (arithmetic x, arithmetic y);
2029729cf09SDimitry Andric float          fminf(float x, float y);
2039729cf09SDimitry Andric long double    fminl(long double x, long double y);
2049729cf09SDimitry Andric 
2059729cf09SDimitry Andric floating_point hypot (arithmetic x, arithmetic y);
2069729cf09SDimitry Andric float          hypotf(float x, float y);
2079729cf09SDimitry Andric long double    hypotl(long double x, long double y);
2089729cf09SDimitry Andric 
2099729cf09SDimitry Andric int ilogb (arithmetic x);
2109729cf09SDimitry Andric int ilogbf(float x);
2119729cf09SDimitry Andric int ilogbl(long double x);
2129729cf09SDimitry Andric 
2139729cf09SDimitry Andric floating_point lgamma (arithmetic x);
2149729cf09SDimitry Andric float          lgammaf(float x);
2159729cf09SDimitry Andric long double    lgammal(long double x);
2169729cf09SDimitry Andric 
2179729cf09SDimitry Andric long long llrint (arithmetic x);
2189729cf09SDimitry Andric long long llrintf(float x);
2199729cf09SDimitry Andric long long llrintl(long double x);
2209729cf09SDimitry Andric 
2219729cf09SDimitry Andric long long llround (arithmetic x);
2229729cf09SDimitry Andric long long llroundf(float x);
2239729cf09SDimitry Andric long long llroundl(long double x);
2249729cf09SDimitry Andric 
2259729cf09SDimitry Andric floating_point log1p (arithmetic x);
2269729cf09SDimitry Andric float          log1pf(float x);
2279729cf09SDimitry Andric long double    log1pl(long double x);
2289729cf09SDimitry Andric 
2299729cf09SDimitry Andric floating_point log2 (arithmetic x);
2309729cf09SDimitry Andric float          log2f(float x);
2319729cf09SDimitry Andric long double    log2l(long double x);
2329729cf09SDimitry Andric 
2339729cf09SDimitry Andric floating_point logb (arithmetic x);
2349729cf09SDimitry Andric float          logbf(float x);
2359729cf09SDimitry Andric long double    logbl(long double x);
2369729cf09SDimitry Andric 
2379729cf09SDimitry Andric long lrint (arithmetic x);
2389729cf09SDimitry Andric long lrintf(float x);
2399729cf09SDimitry Andric long lrintl(long double x);
2409729cf09SDimitry Andric 
2419729cf09SDimitry Andric long lround (arithmetic x);
2429729cf09SDimitry Andric long lroundf(float x);
2439729cf09SDimitry Andric long lroundl(long double x);
2449729cf09SDimitry Andric 
2459729cf09SDimitry Andric double      nan (const char* str);
2469729cf09SDimitry Andric float       nanf(const char* str);
2479729cf09SDimitry Andric long double nanl(const char* str);
2489729cf09SDimitry Andric 
2499729cf09SDimitry Andric floating_point nearbyint (arithmetic x);
2509729cf09SDimitry Andric float          nearbyintf(float x);
2519729cf09SDimitry Andric long double    nearbyintl(long double x);
2529729cf09SDimitry Andric 
2539729cf09SDimitry Andric floating_point nextafter (arithmetic x, arithmetic y);
2549729cf09SDimitry Andric float          nextafterf(float x, float y);
2559729cf09SDimitry Andric long double    nextafterl(long double x, long double y);
2569729cf09SDimitry Andric 
2579729cf09SDimitry Andric floating_point nexttoward (arithmetic x, long double y);
2589729cf09SDimitry Andric float          nexttowardf(float x, long double y);
2599729cf09SDimitry Andric long double    nexttowardl(long double x, long double y);
2609729cf09SDimitry Andric 
2619729cf09SDimitry Andric floating_point remainder (arithmetic x, arithmetic y);
2629729cf09SDimitry Andric float          remainderf(float x, float y);
2639729cf09SDimitry Andric long double    remainderl(long double x, long double y);
2649729cf09SDimitry Andric 
2659729cf09SDimitry Andric floating_point remquo (arithmetic x, arithmetic y, int* pquo);
2669729cf09SDimitry Andric float          remquof(float x, float y, int* pquo);
2679729cf09SDimitry Andric long double    remquol(long double x, long double y, int* pquo);
2689729cf09SDimitry Andric 
2699729cf09SDimitry Andric floating_point rint (arithmetic x);
2709729cf09SDimitry Andric float          rintf(float x);
2719729cf09SDimitry Andric long double    rintl(long double x);
2729729cf09SDimitry Andric 
2739729cf09SDimitry Andric floating_point round (arithmetic x);
2749729cf09SDimitry Andric float          roundf(float x);
2759729cf09SDimitry Andric long double    roundl(long double x);
2769729cf09SDimitry Andric 
2779729cf09SDimitry Andric floating_point scalbln (arithmetic x, long ex);
2789729cf09SDimitry Andric float          scalblnf(float x, long ex);
2799729cf09SDimitry Andric long double    scalblnl(long double x, long ex);
2809729cf09SDimitry Andric 
2819729cf09SDimitry Andric floating_point scalbn (arithmetic x, int ex);
2829729cf09SDimitry Andric float          scalbnf(float x, int ex);
2839729cf09SDimitry Andric long double    scalbnl(long double x, int ex);
2849729cf09SDimitry Andric 
2859729cf09SDimitry Andric floating_point tgamma (arithmetic x);
2869729cf09SDimitry Andric float          tgammaf(float x);
2879729cf09SDimitry Andric long double    tgammal(long double x);
2889729cf09SDimitry Andric 
2899729cf09SDimitry Andric floating_point trunc (arithmetic x);
2909729cf09SDimitry Andric float          truncf(float x);
2919729cf09SDimitry Andric long double    truncl(long double x);
2929729cf09SDimitry Andric 
2939729cf09SDimitry Andric */
2949729cf09SDimitry Andric 
2959729cf09SDimitry Andric #include <__config>
2969729cf09SDimitry Andric 
2979729cf09SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2989729cf09SDimitry Andric #pragma GCC system_header
2999729cf09SDimitry Andric #endif
3009729cf09SDimitry Andric 
3019729cf09SDimitry Andric #include_next <math.h>
3029729cf09SDimitry Andric 
3039729cf09SDimitry Andric #ifdef __cplusplus
3049729cf09SDimitry Andric 
3059729cf09SDimitry Andric // We support including .h headers inside 'extern "C"' contexts, so switch
3069729cf09SDimitry Andric // back to C++ linkage before including these C++ headers.
3079729cf09SDimitry Andric extern "C++" {
3089729cf09SDimitry Andric 
3099729cf09SDimitry Andric #include <type_traits>
31051690af2SDimitry Andric #include <limits>
3119729cf09SDimitry Andric 
3129729cf09SDimitry Andric // signbit
3139729cf09SDimitry Andric 
3149729cf09SDimitry Andric #ifdef signbit
3159729cf09SDimitry Andric 
3169729cf09SDimitry Andric template <class _A1>
317*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
3189729cf09SDimitry Andric bool
__libcpp_signbit(_A1 __lcpp_x)3199729cf09SDimitry Andric __libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
3209729cf09SDimitry Andric {
3219729cf09SDimitry Andric     return signbit(__lcpp_x);
3229729cf09SDimitry Andric }
3239729cf09SDimitry Andric 
3249729cf09SDimitry Andric #undef signbit
3259729cf09SDimitry Andric 
3269729cf09SDimitry Andric template <class _A1>
3279729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
32851690af2SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
signbit(_A1 __lcpp_x)3299729cf09SDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT
3309729cf09SDimitry Andric {
3319729cf09SDimitry Andric     return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
3329729cf09SDimitry Andric }
3339729cf09SDimitry Andric 
33451690af2SDimitry Andric template <class _A1>
33551690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
33651690af2SDimitry Andric typename std::enable_if<
33751690af2SDimitry Andric     std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
signbit(_A1 __lcpp_x)33851690af2SDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT
33951690af2SDimitry Andric { return __lcpp_x < 0; }
34051690af2SDimitry Andric 
34151690af2SDimitry Andric template <class _A1>
34251690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
34351690af2SDimitry Andric typename std::enable_if<
34451690af2SDimitry Andric     std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
signbit(_A1)34551690af2SDimitry Andric signbit(_A1) _NOEXCEPT
34651690af2SDimitry Andric { return false; }
34751690af2SDimitry Andric 
348540d2a8bSDimitry Andric #elif defined(_LIBCPP_MSVCRT)
349540d2a8bSDimitry Andric 
350540d2a8bSDimitry Andric template <typename _A1>
351540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
35251690af2SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
353540d2a8bSDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT
354540d2a8bSDimitry Andric {
355540d2a8bSDimitry Andric   return ::signbit(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
356540d2a8bSDimitry Andric }
357540d2a8bSDimitry Andric 
35851690af2SDimitry Andric template <class _A1>
35951690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
36051690af2SDimitry Andric typename std::enable_if<
36151690af2SDimitry Andric     std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
36251690af2SDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT
36351690af2SDimitry Andric { return __lcpp_x < 0; }
36451690af2SDimitry Andric 
36551690af2SDimitry Andric template <class _A1>
36651690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
36751690af2SDimitry Andric typename std::enable_if<
36851690af2SDimitry Andric     std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
36951690af2SDimitry Andric signbit(_A1) _NOEXCEPT
37051690af2SDimitry Andric { return false; }
37151690af2SDimitry Andric 
3729729cf09SDimitry Andric #endif  // signbit
3739729cf09SDimitry Andric 
3749729cf09SDimitry Andric // fpclassify
3759729cf09SDimitry Andric 
3769729cf09SDimitry Andric #ifdef fpclassify
3779729cf09SDimitry Andric 
3789729cf09SDimitry Andric template <class _A1>
379*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
3809729cf09SDimitry Andric int
__libcpp_fpclassify(_A1 __lcpp_x)3819729cf09SDimitry Andric __libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
3829729cf09SDimitry Andric {
3839729cf09SDimitry Andric     return fpclassify(__lcpp_x);
3849729cf09SDimitry Andric }
3859729cf09SDimitry Andric 
3869729cf09SDimitry Andric #undef fpclassify
3879729cf09SDimitry Andric 
3889729cf09SDimitry Andric template <class _A1>
3899729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
39051690af2SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
fpclassify(_A1 __lcpp_x)3919729cf09SDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT
3929729cf09SDimitry Andric {
3939729cf09SDimitry Andric     return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
3949729cf09SDimitry Andric }
3959729cf09SDimitry Andric 
39651690af2SDimitry Andric template <class _A1>
39751690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
39851690af2SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, int>::type
fpclassify(_A1 __lcpp_x)39951690af2SDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT
40051690af2SDimitry Andric { return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
40151690af2SDimitry Andric 
402540d2a8bSDimitry Andric #elif defined(_LIBCPP_MSVCRT)
403540d2a8bSDimitry Andric 
404540d2a8bSDimitry Andric template <typename _A1>
405540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
40651690af2SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
fpclassify(_A1 __lcpp_x)407540d2a8bSDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT
408540d2a8bSDimitry Andric {
409540d2a8bSDimitry Andric   return ::fpclassify(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
410540d2a8bSDimitry Andric }
411540d2a8bSDimitry Andric 
41251690af2SDimitry Andric template <class _A1>
41351690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
41451690af2SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, int>::type
fpclassify(_A1 __lcpp_x)41551690af2SDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT
41651690af2SDimitry Andric { return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
41751690af2SDimitry Andric 
4189729cf09SDimitry Andric #endif  // fpclassify
4199729cf09SDimitry Andric 
4209729cf09SDimitry Andric // isfinite
4219729cf09SDimitry Andric 
4229729cf09SDimitry Andric #ifdef isfinite
4239729cf09SDimitry Andric 
4249729cf09SDimitry Andric template <class _A1>
425*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
4269729cf09SDimitry Andric bool
__libcpp_isfinite(_A1 __lcpp_x)4279729cf09SDimitry Andric __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
4289729cf09SDimitry Andric {
4299729cf09SDimitry Andric     return isfinite(__lcpp_x);
4309729cf09SDimitry Andric }
4319729cf09SDimitry Andric 
4329729cf09SDimitry Andric #undef isfinite
4339729cf09SDimitry Andric 
4349729cf09SDimitry Andric template <class _A1>
4359729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
43651690af2SDimitry Andric typename std::enable_if<
43751690af2SDimitry Andric     std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
43851690af2SDimitry Andric     bool>::type
isfinite(_A1 __lcpp_x)4399729cf09SDimitry Andric isfinite(_A1 __lcpp_x) _NOEXCEPT
4409729cf09SDimitry Andric {
4419729cf09SDimitry Andric     return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
4429729cf09SDimitry Andric }
4439729cf09SDimitry Andric 
44451690af2SDimitry Andric template <class _A1>
44551690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
44651690af2SDimitry Andric typename std::enable_if<
44751690af2SDimitry Andric     std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
44851690af2SDimitry Andric     bool>::type
isfinite(_A1)44951690af2SDimitry Andric isfinite(_A1) _NOEXCEPT
45051690af2SDimitry Andric { return true; }
45151690af2SDimitry Andric 
4529729cf09SDimitry Andric #endif  // isfinite
4539729cf09SDimitry Andric 
4549729cf09SDimitry Andric // isinf
4559729cf09SDimitry Andric 
4569729cf09SDimitry Andric #ifdef isinf
4579729cf09SDimitry Andric 
4589729cf09SDimitry Andric template <class _A1>
459*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
4609729cf09SDimitry Andric bool
__libcpp_isinf(_A1 __lcpp_x)4619729cf09SDimitry Andric __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
4629729cf09SDimitry Andric {
4639729cf09SDimitry Andric     return isinf(__lcpp_x);
4649729cf09SDimitry Andric }
4659729cf09SDimitry Andric 
4669729cf09SDimitry Andric #undef isinf
4679729cf09SDimitry Andric 
4689729cf09SDimitry Andric template <class _A1>
4699729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
47051690af2SDimitry Andric typename std::enable_if<
47151690af2SDimitry Andric     std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
47251690af2SDimitry Andric     bool>::type
isinf(_A1 __lcpp_x)4739729cf09SDimitry Andric isinf(_A1 __lcpp_x) _NOEXCEPT
4749729cf09SDimitry Andric {
4759729cf09SDimitry Andric     return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
4769729cf09SDimitry Andric }
4779729cf09SDimitry Andric 
47851690af2SDimitry Andric template <class _A1>
47951690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
48051690af2SDimitry Andric typename std::enable_if<
48151690af2SDimitry Andric     std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
48251690af2SDimitry Andric     bool>::type
isinf(_A1)48351690af2SDimitry Andric isinf(_A1) _NOEXCEPT
48451690af2SDimitry Andric { return false; }
48551690af2SDimitry Andric 
486*4ba319b5SDimitry Andric #ifdef _LIBCPP_PREFERRED_OVERLOAD
487*4ba319b5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
488*4ba319b5SDimitry Andric bool
isinf(float __lcpp_x)489*4ba319b5SDimitry Andric isinf(float __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); }
490*4ba319b5SDimitry Andric 
491*4ba319b5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
492*4ba319b5SDimitry Andric bool
isinf(double __lcpp_x)493*4ba319b5SDimitry Andric isinf(double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); }
494*4ba319b5SDimitry Andric 
495*4ba319b5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
496*4ba319b5SDimitry Andric bool
isinf(long double __lcpp_x)497*4ba319b5SDimitry Andric isinf(long double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); }
498*4ba319b5SDimitry Andric #endif
499*4ba319b5SDimitry Andric 
5009729cf09SDimitry Andric #endif  // isinf
5019729cf09SDimitry Andric 
5029729cf09SDimitry Andric // isnan
5039729cf09SDimitry Andric 
5049729cf09SDimitry Andric #ifdef isnan
5059729cf09SDimitry Andric 
5069729cf09SDimitry Andric template <class _A1>
507*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
5089729cf09SDimitry Andric bool
__libcpp_isnan(_A1 __lcpp_x)5099729cf09SDimitry Andric __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
5109729cf09SDimitry Andric {
5119729cf09SDimitry Andric     return isnan(__lcpp_x);
5129729cf09SDimitry Andric }
5139729cf09SDimitry Andric 
5149729cf09SDimitry Andric #undef isnan
5159729cf09SDimitry Andric 
5169729cf09SDimitry Andric template <class _A1>
5179729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
51851690af2SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnan(_A1 __lcpp_x)5199729cf09SDimitry Andric isnan(_A1 __lcpp_x) _NOEXCEPT
5209729cf09SDimitry Andric {
5219729cf09SDimitry Andric     return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
5229729cf09SDimitry Andric }
5239729cf09SDimitry Andric 
52451690af2SDimitry Andric template <class _A1>
52551690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
52651690af2SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, bool>::type
isnan(_A1)52751690af2SDimitry Andric isnan(_A1) _NOEXCEPT
52851690af2SDimitry Andric { return false; }
52951690af2SDimitry Andric 
530*4ba319b5SDimitry Andric #ifdef _LIBCPP_PREFERRED_OVERLOAD
531*4ba319b5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
532*4ba319b5SDimitry Andric bool
isnan(float __lcpp_x)533*4ba319b5SDimitry Andric isnan(float __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
534*4ba319b5SDimitry Andric 
535*4ba319b5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
536*4ba319b5SDimitry Andric bool
isnan(double __lcpp_x)537*4ba319b5SDimitry Andric isnan(double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
538*4ba319b5SDimitry Andric 
539*4ba319b5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
540*4ba319b5SDimitry Andric bool
isnan(long double __lcpp_x)541*4ba319b5SDimitry Andric isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); }
542*4ba319b5SDimitry Andric #endif
543*4ba319b5SDimitry Andric 
5449729cf09SDimitry Andric #endif  // isnan
5459729cf09SDimitry Andric 
5469729cf09SDimitry Andric // isnormal
5479729cf09SDimitry Andric 
5489729cf09SDimitry Andric #ifdef isnormal
5499729cf09SDimitry Andric 
5509729cf09SDimitry Andric template <class _A1>
551*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
5529729cf09SDimitry Andric bool
__libcpp_isnormal(_A1 __lcpp_x)5539729cf09SDimitry Andric __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
5549729cf09SDimitry Andric {
5559729cf09SDimitry Andric     return isnormal(__lcpp_x);
5569729cf09SDimitry Andric }
5579729cf09SDimitry Andric 
5589729cf09SDimitry Andric #undef isnormal
5599729cf09SDimitry Andric 
5609729cf09SDimitry Andric template <class _A1>
5619729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
56251690af2SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
isnormal(_A1 __lcpp_x)5639729cf09SDimitry Andric isnormal(_A1 __lcpp_x) _NOEXCEPT
5649729cf09SDimitry Andric {
5659729cf09SDimitry Andric     return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
5669729cf09SDimitry Andric }
5679729cf09SDimitry Andric 
56851690af2SDimitry Andric template <class _A1>
56951690af2SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
57051690af2SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, bool>::type
isnormal(_A1 __lcpp_x)57151690af2SDimitry Andric isnormal(_A1 __lcpp_x) _NOEXCEPT
57251690af2SDimitry Andric { return __lcpp_x != 0; }
57351690af2SDimitry Andric 
5749729cf09SDimitry Andric #endif  // isnormal
5759729cf09SDimitry Andric 
5769729cf09SDimitry Andric // isgreater
5779729cf09SDimitry Andric 
5789729cf09SDimitry Andric #ifdef isgreater
5799729cf09SDimitry Andric 
5809729cf09SDimitry Andric template <class _A1, class _A2>
581*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
5829729cf09SDimitry Andric bool
__libcpp_isgreater(_A1 __lcpp_x,_A2 __lcpp_y)5839729cf09SDimitry Andric __libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
5849729cf09SDimitry Andric {
5859729cf09SDimitry Andric     return isgreater(__lcpp_x, __lcpp_y);
5869729cf09SDimitry Andric }
5879729cf09SDimitry Andric 
5889729cf09SDimitry Andric #undef isgreater
5899729cf09SDimitry Andric 
5909729cf09SDimitry Andric template <class _A1, class _A2>
5919729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
5929729cf09SDimitry Andric typename std::enable_if
5939729cf09SDimitry Andric <
5949729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
5959729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
5969729cf09SDimitry Andric     bool
5979729cf09SDimitry Andric >::type
isgreater(_A1 __lcpp_x,_A2 __lcpp_y)5989729cf09SDimitry Andric isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
5999729cf09SDimitry Andric {
6009729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type type;
6019729cf09SDimitry Andric     return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
6029729cf09SDimitry Andric }
6039729cf09SDimitry Andric 
6049729cf09SDimitry Andric #endif  // isgreater
6059729cf09SDimitry Andric 
6069729cf09SDimitry Andric // isgreaterequal
6079729cf09SDimitry Andric 
6089729cf09SDimitry Andric #ifdef isgreaterequal
6099729cf09SDimitry Andric 
6109729cf09SDimitry Andric template <class _A1, class _A2>
611*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
6129729cf09SDimitry Andric bool
__libcpp_isgreaterequal(_A1 __lcpp_x,_A2 __lcpp_y)6139729cf09SDimitry Andric __libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
6149729cf09SDimitry Andric {
6159729cf09SDimitry Andric     return isgreaterequal(__lcpp_x, __lcpp_y);
6169729cf09SDimitry Andric }
6179729cf09SDimitry Andric 
6189729cf09SDimitry Andric #undef isgreaterequal
6199729cf09SDimitry Andric 
6209729cf09SDimitry Andric template <class _A1, class _A2>
6219729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
6229729cf09SDimitry Andric typename std::enable_if
6239729cf09SDimitry Andric <
6249729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
6259729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
6269729cf09SDimitry Andric     bool
6279729cf09SDimitry Andric >::type
isgreaterequal(_A1 __lcpp_x,_A2 __lcpp_y)6289729cf09SDimitry Andric isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
6299729cf09SDimitry Andric {
6309729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type type;
6319729cf09SDimitry Andric     return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
6329729cf09SDimitry Andric }
6339729cf09SDimitry Andric 
6349729cf09SDimitry Andric #endif  // isgreaterequal
6359729cf09SDimitry Andric 
6369729cf09SDimitry Andric // isless
6379729cf09SDimitry Andric 
6389729cf09SDimitry Andric #ifdef isless
6399729cf09SDimitry Andric 
6409729cf09SDimitry Andric template <class _A1, class _A2>
641*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
6429729cf09SDimitry Andric bool
__libcpp_isless(_A1 __lcpp_x,_A2 __lcpp_y)6439729cf09SDimitry Andric __libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
6449729cf09SDimitry Andric {
6459729cf09SDimitry Andric     return isless(__lcpp_x, __lcpp_y);
6469729cf09SDimitry Andric }
6479729cf09SDimitry Andric 
6489729cf09SDimitry Andric #undef isless
6499729cf09SDimitry Andric 
6509729cf09SDimitry Andric template <class _A1, class _A2>
6519729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
6529729cf09SDimitry Andric typename std::enable_if
6539729cf09SDimitry Andric <
6549729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
6559729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
6569729cf09SDimitry Andric     bool
6579729cf09SDimitry Andric >::type
isless(_A1 __lcpp_x,_A2 __lcpp_y)6589729cf09SDimitry Andric isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
6599729cf09SDimitry Andric {
6609729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type type;
6619729cf09SDimitry Andric     return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
6629729cf09SDimitry Andric }
6639729cf09SDimitry Andric 
6649729cf09SDimitry Andric #endif  // isless
6659729cf09SDimitry Andric 
6669729cf09SDimitry Andric // islessequal
6679729cf09SDimitry Andric 
6689729cf09SDimitry Andric #ifdef islessequal
6699729cf09SDimitry Andric 
6709729cf09SDimitry Andric template <class _A1, class _A2>
671*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
6729729cf09SDimitry Andric bool
__libcpp_islessequal(_A1 __lcpp_x,_A2 __lcpp_y)6739729cf09SDimitry Andric __libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
6749729cf09SDimitry Andric {
6759729cf09SDimitry Andric     return islessequal(__lcpp_x, __lcpp_y);
6769729cf09SDimitry Andric }
6779729cf09SDimitry Andric 
6789729cf09SDimitry Andric #undef islessequal
6799729cf09SDimitry Andric 
6809729cf09SDimitry Andric template <class _A1, class _A2>
6819729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
6829729cf09SDimitry Andric typename std::enable_if
6839729cf09SDimitry Andric <
6849729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
6859729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
6869729cf09SDimitry Andric     bool
6879729cf09SDimitry Andric >::type
islessequal(_A1 __lcpp_x,_A2 __lcpp_y)6889729cf09SDimitry Andric islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
6899729cf09SDimitry Andric {
6909729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type type;
6919729cf09SDimitry Andric     return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
6929729cf09SDimitry Andric }
6939729cf09SDimitry Andric 
6949729cf09SDimitry Andric #endif  // islessequal
6959729cf09SDimitry Andric 
6969729cf09SDimitry Andric // islessgreater
6979729cf09SDimitry Andric 
6989729cf09SDimitry Andric #ifdef islessgreater
6999729cf09SDimitry Andric 
7009729cf09SDimitry Andric template <class _A1, class _A2>
701*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
7029729cf09SDimitry Andric bool
__libcpp_islessgreater(_A1 __lcpp_x,_A2 __lcpp_y)7039729cf09SDimitry Andric __libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
7049729cf09SDimitry Andric {
7059729cf09SDimitry Andric     return islessgreater(__lcpp_x, __lcpp_y);
7069729cf09SDimitry Andric }
7079729cf09SDimitry Andric 
7089729cf09SDimitry Andric #undef islessgreater
7099729cf09SDimitry Andric 
7109729cf09SDimitry Andric template <class _A1, class _A2>
7119729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
7129729cf09SDimitry Andric typename std::enable_if
7139729cf09SDimitry Andric <
7149729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
7159729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
7169729cf09SDimitry Andric     bool
7179729cf09SDimitry Andric >::type
islessgreater(_A1 __lcpp_x,_A2 __lcpp_y)7189729cf09SDimitry Andric islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
7199729cf09SDimitry Andric {
7209729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type type;
7219729cf09SDimitry Andric     return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
7229729cf09SDimitry Andric }
7239729cf09SDimitry Andric 
7249729cf09SDimitry Andric #endif  // islessgreater
7259729cf09SDimitry Andric 
7269729cf09SDimitry Andric // isunordered
7279729cf09SDimitry Andric 
7289729cf09SDimitry Andric #ifdef isunordered
7299729cf09SDimitry Andric 
7309729cf09SDimitry Andric template <class _A1, class _A2>
731*4ba319b5SDimitry Andric _LIBCPP_INLINE_VISIBILITY
7329729cf09SDimitry Andric bool
__libcpp_isunordered(_A1 __lcpp_x,_A2 __lcpp_y)7339729cf09SDimitry Andric __libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
7349729cf09SDimitry Andric {
7359729cf09SDimitry Andric     return isunordered(__lcpp_x, __lcpp_y);
7369729cf09SDimitry Andric }
7379729cf09SDimitry Andric 
7389729cf09SDimitry Andric #undef isunordered
7399729cf09SDimitry Andric 
7409729cf09SDimitry Andric template <class _A1, class _A2>
7419729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
7429729cf09SDimitry Andric typename std::enable_if
7439729cf09SDimitry Andric <
7449729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
7459729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
7469729cf09SDimitry Andric     bool
7479729cf09SDimitry Andric >::type
isunordered(_A1 __lcpp_x,_A2 __lcpp_y)7489729cf09SDimitry Andric isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
7499729cf09SDimitry Andric {
7509729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type type;
7519729cf09SDimitry Andric     return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
7529729cf09SDimitry Andric }
7539729cf09SDimitry Andric 
7549729cf09SDimitry Andric #endif  // isunordered
7559729cf09SDimitry Andric 
7569729cf09SDimitry Andric // abs
7579729cf09SDimitry Andric 
758aed8d94eSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
7599729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
7609729cf09SDimitry Andric float
abs(float __lcpp_x)761540d2a8bSDimitry Andric abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
7629729cf09SDimitry Andric 
7639729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
7649729cf09SDimitry Andric double
abs(double __lcpp_x)765540d2a8bSDimitry Andric abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);}
7669729cf09SDimitry Andric 
7679729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
7689729cf09SDimitry Andric long double
abs(long double __lcpp_x)769540d2a8bSDimitry Andric abs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
770aed8d94eSDimitry Andric #endif // !(defined(_AIX) || defined(__sun__))
7719729cf09SDimitry Andric 
7729729cf09SDimitry Andric // acos
7739729cf09SDimitry Andric 
774540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
acos(float __lcpp_x)775540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       acos(float __lcpp_x) _NOEXCEPT       {return ::acosf(__lcpp_x);}
acos(long double __lcpp_x)776540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
7779729cf09SDimitry Andric #endif
7789729cf09SDimitry Andric 
7799729cf09SDimitry Andric template <class _A1>
7809729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
7819729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
acos(_A1 __lcpp_x)782540d2a8bSDimitry Andric acos(_A1 __lcpp_x) _NOEXCEPT {return ::acos((double)__lcpp_x);}
7839729cf09SDimitry Andric 
7849729cf09SDimitry Andric // asin
7859729cf09SDimitry Andric 
786540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
asin(float __lcpp_x)787540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       asin(float __lcpp_x) _NOEXCEPT       {return ::asinf(__lcpp_x);}
asin(long double __lcpp_x)788540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);}
7899729cf09SDimitry Andric #endif
7909729cf09SDimitry Andric 
7919729cf09SDimitry Andric template <class _A1>
7929729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
7939729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
asin(_A1 __lcpp_x)794540d2a8bSDimitry Andric asin(_A1 __lcpp_x) _NOEXCEPT {return ::asin((double)__lcpp_x);}
7959729cf09SDimitry Andric 
7969729cf09SDimitry Andric // atan
7979729cf09SDimitry Andric 
798540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
atan(float __lcpp_x)799540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       atan(float __lcpp_x) _NOEXCEPT       {return ::atanf(__lcpp_x);}
atan(long double __lcpp_x)800540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);}
8019729cf09SDimitry Andric #endif
8029729cf09SDimitry Andric 
8039729cf09SDimitry Andric template <class _A1>
8049729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
8059729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
atan(_A1 __lcpp_x)806540d2a8bSDimitry Andric atan(_A1 __lcpp_x) _NOEXCEPT {return ::atan((double)__lcpp_x);}
8079729cf09SDimitry Andric 
8089729cf09SDimitry Andric // atan2
8099729cf09SDimitry Andric 
810540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
atan2(float __lcpp_y,float __lcpp_x)811540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT             {return ::atan2f(__lcpp_y, __lcpp_x);}
atan2(long double __lcpp_y,long double __lcpp_x)812540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);}
8139729cf09SDimitry Andric #endif
8149729cf09SDimitry Andric 
8159729cf09SDimitry Andric template <class _A1, class _A2>
8169729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
8179729cf09SDimitry Andric typename std::__lazy_enable_if
8189729cf09SDimitry Andric <
8199729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
8209729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
8219729cf09SDimitry Andric     std::__promote<_A1, _A2>
8229729cf09SDimitry Andric >::type
atan2(_A1 __lcpp_y,_A2 __lcpp_x)8239729cf09SDimitry Andric atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
8249729cf09SDimitry Andric {
8259729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
8269729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
8279729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
828540d2a8bSDimitry Andric     return ::atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
8299729cf09SDimitry Andric }
8309729cf09SDimitry Andric 
8319729cf09SDimitry Andric // ceil
8329729cf09SDimitry Andric 
833540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
ceil(float __lcpp_x)834540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       ceil(float __lcpp_x) _NOEXCEPT       {return ::ceilf(__lcpp_x);}
ceil(long double __lcpp_x)835540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);}
8369729cf09SDimitry Andric #endif
8379729cf09SDimitry Andric 
8389729cf09SDimitry Andric template <class _A1>
8399729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
8409729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
ceil(_A1 __lcpp_x)841540d2a8bSDimitry Andric ceil(_A1 __lcpp_x) _NOEXCEPT {return ::ceil((double)__lcpp_x);}
8429729cf09SDimitry Andric 
8439729cf09SDimitry Andric // cos
8449729cf09SDimitry Andric 
845540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
cos(float __lcpp_x)846540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       cos(float __lcpp_x) _NOEXCEPT       {return ::cosf(__lcpp_x);}
cos(long double __lcpp_x)847540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);}
8489729cf09SDimitry Andric #endif
8499729cf09SDimitry Andric 
8509729cf09SDimitry Andric template <class _A1>
8519729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
8529729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
cos(_A1 __lcpp_x)853540d2a8bSDimitry Andric cos(_A1 __lcpp_x) _NOEXCEPT {return ::cos((double)__lcpp_x);}
8549729cf09SDimitry Andric 
8559729cf09SDimitry Andric // cosh
8569729cf09SDimitry Andric 
857540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
cosh(float __lcpp_x)858540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       cosh(float __lcpp_x) _NOEXCEPT       {return ::coshf(__lcpp_x);}
cosh(long double __lcpp_x)859540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);}
8609729cf09SDimitry Andric #endif
8619729cf09SDimitry Andric 
8629729cf09SDimitry Andric template <class _A1>
8639729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
8649729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
cosh(_A1 __lcpp_x)865540d2a8bSDimitry Andric cosh(_A1 __lcpp_x) _NOEXCEPT {return ::cosh((double)__lcpp_x);}
8669729cf09SDimitry Andric 
8679729cf09SDimitry Andric // exp
8689729cf09SDimitry Andric 
869540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
exp(float __lcpp_x)870540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       exp(float __lcpp_x) _NOEXCEPT       {return ::expf(__lcpp_x);}
exp(long double __lcpp_x)871540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);}
8729729cf09SDimitry Andric #endif
8739729cf09SDimitry Andric 
8749729cf09SDimitry Andric template <class _A1>
8759729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
8769729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
exp(_A1 __lcpp_x)877540d2a8bSDimitry Andric exp(_A1 __lcpp_x) _NOEXCEPT {return ::exp((double)__lcpp_x);}
8789729cf09SDimitry Andric 
8799729cf09SDimitry Andric // fabs
8809729cf09SDimitry Andric 
881540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
fabs(float __lcpp_x)882540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       fabs(float __lcpp_x) _NOEXCEPT       {return ::fabsf(__lcpp_x);}
fabs(long double __lcpp_x)883540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
8849729cf09SDimitry Andric #endif
8859729cf09SDimitry Andric 
8869729cf09SDimitry Andric template <class _A1>
8879729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
8889729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
fabs(_A1 __lcpp_x)889540d2a8bSDimitry Andric fabs(_A1 __lcpp_x) _NOEXCEPT {return ::fabs((double)__lcpp_x);}
8909729cf09SDimitry Andric 
8919729cf09SDimitry Andric // floor
8929729cf09SDimitry Andric 
893540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
floor(float __lcpp_x)894540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       floor(float __lcpp_x) _NOEXCEPT       {return ::floorf(__lcpp_x);}
floor(long double __lcpp_x)895540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);}
8969729cf09SDimitry Andric #endif
8979729cf09SDimitry Andric 
8989729cf09SDimitry Andric template <class _A1>
8999729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
9009729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
floor(_A1 __lcpp_x)901540d2a8bSDimitry Andric floor(_A1 __lcpp_x) _NOEXCEPT {return ::floor((double)__lcpp_x);}
9029729cf09SDimitry Andric 
9039729cf09SDimitry Andric // fmod
9049729cf09SDimitry Andric 
905540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
fmod(float __lcpp_x,float __lcpp_y)906540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmodf(__lcpp_x, __lcpp_y);}
fmod(long double __lcpp_x,long double __lcpp_y)907540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);}
9089729cf09SDimitry Andric #endif
9099729cf09SDimitry Andric 
9109729cf09SDimitry Andric template <class _A1, class _A2>
9119729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
9129729cf09SDimitry Andric typename std::__lazy_enable_if
9139729cf09SDimitry Andric <
9149729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
9159729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
9169729cf09SDimitry Andric     std::__promote<_A1, _A2>
9179729cf09SDimitry Andric >::type
fmod(_A1 __lcpp_x,_A2 __lcpp_y)9189729cf09SDimitry Andric fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
9199729cf09SDimitry Andric {
9209729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
9219729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
9229729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
923540d2a8bSDimitry Andric     return ::fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
9249729cf09SDimitry Andric }
9259729cf09SDimitry Andric 
9269729cf09SDimitry Andric // frexp
9279729cf09SDimitry Andric 
928540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
frexp(float __lcpp_x,int * __lcpp_e)929540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT       {return ::frexpf(__lcpp_x, __lcpp_e);}
frexp(long double __lcpp_x,int * __lcpp_e)930540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);}
9319729cf09SDimitry Andric #endif
9329729cf09SDimitry Andric 
9339729cf09SDimitry Andric template <class _A1>
9349729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
9359729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
frexp(_A1 __lcpp_x,int * __lcpp_e)936540d2a8bSDimitry Andric frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexp((double)__lcpp_x, __lcpp_e);}
9379729cf09SDimitry Andric 
9389729cf09SDimitry Andric // ldexp
9399729cf09SDimitry Andric 
940540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
ldexp(float __lcpp_x,int __lcpp_e)941540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT       {return ::ldexpf(__lcpp_x, __lcpp_e);}
ldexp(long double __lcpp_x,int __lcpp_e)942540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);}
9439729cf09SDimitry Andric #endif
9449729cf09SDimitry Andric 
9459729cf09SDimitry Andric template <class _A1>
9469729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
9479729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
ldexp(_A1 __lcpp_x,int __lcpp_e)948540d2a8bSDimitry Andric ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexp((double)__lcpp_x, __lcpp_e);}
9499729cf09SDimitry Andric 
9509729cf09SDimitry Andric // log
9519729cf09SDimitry Andric 
952540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
log(float __lcpp_x)953540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       log(float __lcpp_x) _NOEXCEPT       {return ::logf(__lcpp_x);}
log(long double __lcpp_x)954540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);}
9559729cf09SDimitry Andric #endif
9569729cf09SDimitry Andric 
9579729cf09SDimitry Andric template <class _A1>
9589729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
9599729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
log(_A1 __lcpp_x)960540d2a8bSDimitry Andric log(_A1 __lcpp_x) _NOEXCEPT {return ::log((double)__lcpp_x);}
9619729cf09SDimitry Andric 
9629729cf09SDimitry Andric // log10
9639729cf09SDimitry Andric 
964540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
log10(float __lcpp_x)965540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       log10(float __lcpp_x) _NOEXCEPT       {return ::log10f(__lcpp_x);}
log10(long double __lcpp_x)966540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);}
9679729cf09SDimitry Andric #endif
9689729cf09SDimitry Andric 
9699729cf09SDimitry Andric template <class _A1>
9709729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
9719729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
log10(_A1 __lcpp_x)972540d2a8bSDimitry Andric log10(_A1 __lcpp_x) _NOEXCEPT {return ::log10((double)__lcpp_x);}
9739729cf09SDimitry Andric 
9749729cf09SDimitry Andric // modf
9759729cf09SDimitry Andric 
976540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
modf(float __lcpp_x,float * __lcpp_y)977540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT             {return ::modff(__lcpp_x, __lcpp_y);}
modf(long double __lcpp_x,long double * __lcpp_y)978540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);}
9799729cf09SDimitry Andric #endif
9809729cf09SDimitry Andric 
9819729cf09SDimitry Andric // pow
9829729cf09SDimitry Andric 
983540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
pow(float __lcpp_x,float __lcpp_y)984540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::powf(__lcpp_x, __lcpp_y);}
pow(long double __lcpp_x,long double __lcpp_y)985540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);}
9869729cf09SDimitry Andric #endif
9879729cf09SDimitry Andric 
9889729cf09SDimitry Andric template <class _A1, class _A2>
9899729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
9909729cf09SDimitry Andric typename std::__lazy_enable_if
9919729cf09SDimitry Andric <
9929729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
9939729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
9949729cf09SDimitry Andric     std::__promote<_A1, _A2>
9959729cf09SDimitry Andric >::type
pow(_A1 __lcpp_x,_A2 __lcpp_y)9969729cf09SDimitry Andric pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
9979729cf09SDimitry Andric {
9989729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
9999729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
10009729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1001540d2a8bSDimitry Andric     return ::pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
10029729cf09SDimitry Andric }
10039729cf09SDimitry Andric 
10049729cf09SDimitry Andric // sin
10059729cf09SDimitry Andric 
1006540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
sin(float __lcpp_x)1007540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       sin(float __lcpp_x) _NOEXCEPT       {return ::sinf(__lcpp_x);}
sin(long double __lcpp_x)1008540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);}
10099729cf09SDimitry Andric #endif
10109729cf09SDimitry Andric 
10119729cf09SDimitry Andric template <class _A1>
10129729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10139729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
sin(_A1 __lcpp_x)1014540d2a8bSDimitry Andric sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
10159729cf09SDimitry Andric 
10169729cf09SDimitry Andric // sinh
10179729cf09SDimitry Andric 
1018540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
sinh(float __lcpp_x)1019540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       sinh(float __lcpp_x) _NOEXCEPT       {return ::sinhf(__lcpp_x);}
sinh(long double __lcpp_x)1020540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);}
10219729cf09SDimitry Andric #endif
10229729cf09SDimitry Andric 
10239729cf09SDimitry Andric template <class _A1>
10249729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10259729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
sinh(_A1 __lcpp_x)1026540d2a8bSDimitry Andric sinh(_A1 __lcpp_x) _NOEXCEPT {return ::sinh((double)__lcpp_x);}
10279729cf09SDimitry Andric 
10289729cf09SDimitry Andric // sqrt
10299729cf09SDimitry Andric 
1030540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
sqrt(float __lcpp_x)1031540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       sqrt(float __lcpp_x) _NOEXCEPT       {return ::sqrtf(__lcpp_x);}
sqrt(long double __lcpp_x)1032540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
10339729cf09SDimitry Andric #endif
10349729cf09SDimitry Andric 
10359729cf09SDimitry Andric template <class _A1>
10369729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10379729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
sqrt(_A1 __lcpp_x)1038540d2a8bSDimitry Andric sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((double)__lcpp_x);}
10399729cf09SDimitry Andric 
10409729cf09SDimitry Andric // tan
10419729cf09SDimitry Andric 
1042540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
tan(float __lcpp_x)1043540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       tan(float __lcpp_x) _NOEXCEPT       {return ::tanf(__lcpp_x);}
tan(long double __lcpp_x)1044540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);}
10459729cf09SDimitry Andric #endif
10469729cf09SDimitry Andric 
10479729cf09SDimitry Andric template <class _A1>
10489729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10499729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
tan(_A1 __lcpp_x)1050540d2a8bSDimitry Andric tan(_A1 __lcpp_x) _NOEXCEPT {return ::tan((double)__lcpp_x);}
10519729cf09SDimitry Andric 
10529729cf09SDimitry Andric // tanh
10539729cf09SDimitry Andric 
1054540d2a8bSDimitry Andric #if !(defined(_AIX) || defined(__sun__))
tanh(float __lcpp_x)1055540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       tanh(float __lcpp_x) _NOEXCEPT       {return ::tanhf(__lcpp_x);}
tanh(long double __lcpp_x)1056540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);}
10579729cf09SDimitry Andric #endif
10589729cf09SDimitry Andric 
10599729cf09SDimitry Andric template <class _A1>
10609729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10619729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
tanh(_A1 __lcpp_x)1062540d2a8bSDimitry Andric tanh(_A1 __lcpp_x) _NOEXCEPT {return ::tanh((double)__lcpp_x);}
10639729cf09SDimitry Andric 
10649729cf09SDimitry Andric // acosh
10659729cf09SDimitry Andric 
acosh(float __lcpp_x)1066540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       acosh(float __lcpp_x) _NOEXCEPT       {return ::acoshf(__lcpp_x);}
acosh(long double __lcpp_x)1067540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);}
10689729cf09SDimitry Andric 
10699729cf09SDimitry Andric template <class _A1>
10709729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10719729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
acosh(_A1 __lcpp_x)1072540d2a8bSDimitry Andric acosh(_A1 __lcpp_x) _NOEXCEPT {return ::acosh((double)__lcpp_x);}
10739729cf09SDimitry Andric 
10749729cf09SDimitry Andric // asinh
10759729cf09SDimitry Andric 
asinh(float __lcpp_x)1076540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       asinh(float __lcpp_x) _NOEXCEPT       {return ::asinhf(__lcpp_x);}
asinh(long double __lcpp_x)1077540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);}
10789729cf09SDimitry Andric 
10799729cf09SDimitry Andric template <class _A1>
10809729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10819729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
asinh(_A1 __lcpp_x)1082540d2a8bSDimitry Andric asinh(_A1 __lcpp_x) _NOEXCEPT {return ::asinh((double)__lcpp_x);}
10839729cf09SDimitry Andric 
10849729cf09SDimitry Andric // atanh
10859729cf09SDimitry Andric 
atanh(float __lcpp_x)1086540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       atanh(float __lcpp_x) _NOEXCEPT       {return ::atanhf(__lcpp_x);}
atanh(long double __lcpp_x)1087540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);}
10889729cf09SDimitry Andric 
10899729cf09SDimitry Andric template <class _A1>
10909729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
10919729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
atanh(_A1 __lcpp_x)1092540d2a8bSDimitry Andric atanh(_A1 __lcpp_x) _NOEXCEPT {return ::atanh((double)__lcpp_x);}
10939729cf09SDimitry Andric 
10949729cf09SDimitry Andric // cbrt
10959729cf09SDimitry Andric 
cbrt(float __lcpp_x)1096540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       cbrt(float __lcpp_x) _NOEXCEPT       {return ::cbrtf(__lcpp_x);}
cbrt(long double __lcpp_x)1097540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);}
10989729cf09SDimitry Andric 
10999729cf09SDimitry Andric template <class _A1>
11009729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11019729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
cbrt(_A1 __lcpp_x)1102540d2a8bSDimitry Andric cbrt(_A1 __lcpp_x) _NOEXCEPT {return ::cbrt((double)__lcpp_x);}
11039729cf09SDimitry Andric 
11049729cf09SDimitry Andric // copysign
11059729cf09SDimitry Andric 
copysign(float __lcpp_x,float __lcpp_y)11069729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x,
11079729cf09SDimitry Andric                                                 float __lcpp_y) _NOEXCEPT {
1108540d2a8bSDimitry Andric   return ::copysignf(__lcpp_x, __lcpp_y);
11099729cf09SDimitry Andric }
11109729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double
copysign(long double __lcpp_x,long double __lcpp_y)11119729cf09SDimitry Andric copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
1112540d2a8bSDimitry Andric   return ::copysignl(__lcpp_x, __lcpp_y);
11139729cf09SDimitry Andric }
11149729cf09SDimitry Andric 
11159729cf09SDimitry Andric template <class _A1, class _A2>
11169729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11179729cf09SDimitry Andric typename std::__lazy_enable_if
11189729cf09SDimitry Andric <
11199729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
11209729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
11219729cf09SDimitry Andric     std::__promote<_A1, _A2>
11229729cf09SDimitry Andric >::type
copysign(_A1 __lcpp_x,_A2 __lcpp_y)11239729cf09SDimitry Andric copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
11249729cf09SDimitry Andric {
11259729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
11269729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
11279729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1128540d2a8bSDimitry Andric     return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
11299729cf09SDimitry Andric }
11309729cf09SDimitry Andric 
11319729cf09SDimitry Andric // erf
11329729cf09SDimitry Andric 
erf(float __lcpp_x)1133540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       erf(float __lcpp_x) _NOEXCEPT       {return ::erff(__lcpp_x);}
erf(long double __lcpp_x)1134540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);}
11359729cf09SDimitry Andric 
11369729cf09SDimitry Andric template <class _A1>
11379729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11389729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
erf(_A1 __lcpp_x)1139540d2a8bSDimitry Andric erf(_A1 __lcpp_x) _NOEXCEPT {return ::erf((double)__lcpp_x);}
11409729cf09SDimitry Andric 
11419729cf09SDimitry Andric // erfc
11429729cf09SDimitry Andric 
erfc(float __lcpp_x)1143540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       erfc(float __lcpp_x) _NOEXCEPT       {return ::erfcf(__lcpp_x);}
erfc(long double __lcpp_x)1144540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);}
11459729cf09SDimitry Andric 
11469729cf09SDimitry Andric template <class _A1>
11479729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11489729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
erfc(_A1 __lcpp_x)1149540d2a8bSDimitry Andric erfc(_A1 __lcpp_x) _NOEXCEPT {return ::erfc((double)__lcpp_x);}
11509729cf09SDimitry Andric 
11519729cf09SDimitry Andric // exp2
11529729cf09SDimitry Andric 
exp2(float __lcpp_x)1153540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       exp2(float __lcpp_x) _NOEXCEPT       {return ::exp2f(__lcpp_x);}
exp2(long double __lcpp_x)1154540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);}
11559729cf09SDimitry Andric 
11569729cf09SDimitry Andric template <class _A1>
11579729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11589729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
exp2(_A1 __lcpp_x)1159540d2a8bSDimitry Andric exp2(_A1 __lcpp_x) _NOEXCEPT {return ::exp2((double)__lcpp_x);}
11609729cf09SDimitry Andric 
11619729cf09SDimitry Andric // expm1
11629729cf09SDimitry Andric 
expm1(float __lcpp_x)1163540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       expm1(float __lcpp_x) _NOEXCEPT       {return ::expm1f(__lcpp_x);}
expm1(long double __lcpp_x)1164540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);}
11659729cf09SDimitry Andric 
11669729cf09SDimitry Andric template <class _A1>
11679729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11689729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
expm1(_A1 __lcpp_x)1169540d2a8bSDimitry Andric expm1(_A1 __lcpp_x) _NOEXCEPT {return ::expm1((double)__lcpp_x);}
11709729cf09SDimitry Andric 
11719729cf09SDimitry Andric // fdim
11729729cf09SDimitry Andric 
fdim(float __lcpp_x,float __lcpp_y)1173540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fdimf(__lcpp_x, __lcpp_y);}
fdim(long double __lcpp_x,long double __lcpp_y)1174540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);}
11759729cf09SDimitry Andric 
11769729cf09SDimitry Andric template <class _A1, class _A2>
11779729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11789729cf09SDimitry Andric typename std::__lazy_enable_if
11799729cf09SDimitry Andric <
11809729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
11819729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
11829729cf09SDimitry Andric     std::__promote<_A1, _A2>
11839729cf09SDimitry Andric >::type
fdim(_A1 __lcpp_x,_A2 __lcpp_y)11849729cf09SDimitry Andric fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
11859729cf09SDimitry Andric {
11869729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
11879729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
11889729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1189540d2a8bSDimitry Andric     return ::fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
11909729cf09SDimitry Andric }
11919729cf09SDimitry Andric 
11929729cf09SDimitry Andric // fma
11939729cf09SDimitry Andric 
fma(float __lcpp_x,float __lcpp_y,float __lcpp_z)1194540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT                   {return ::fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
fma(long double __lcpp_x,long double __lcpp_y,long double __lcpp_z)1195540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return ::fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
11969729cf09SDimitry Andric 
11979729cf09SDimitry Andric template <class _A1, class _A2, class _A3>
11989729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
11999729cf09SDimitry Andric typename std::__lazy_enable_if
12009729cf09SDimitry Andric <
12019729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
12029729cf09SDimitry Andric     std::is_arithmetic<_A2>::value &&
12039729cf09SDimitry Andric     std::is_arithmetic<_A3>::value,
12049729cf09SDimitry Andric     std::__promote<_A1, _A2, _A3>
12059729cf09SDimitry Andric >::type
fma(_A1 __lcpp_x,_A2 __lcpp_y,_A3 __lcpp_z)12069729cf09SDimitry Andric fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
12079729cf09SDimitry Andric {
12089729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2, _A3>::type __result_type;
12099729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
12109729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value &&
12119729cf09SDimitry Andric                      std::is_same<_A3, __result_type>::value)), "");
1212540d2a8bSDimitry Andric     return ::fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
12139729cf09SDimitry Andric }
12149729cf09SDimitry Andric 
12159729cf09SDimitry Andric // fmax
12169729cf09SDimitry Andric 
fmax(float __lcpp_x,float __lcpp_y)1217540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmaxf(__lcpp_x, __lcpp_y);}
fmax(long double __lcpp_x,long double __lcpp_y)1218540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);}
12199729cf09SDimitry Andric 
12209729cf09SDimitry Andric template <class _A1, class _A2>
12219729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
12229729cf09SDimitry Andric typename std::__lazy_enable_if
12239729cf09SDimitry Andric <
12249729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
12259729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
12269729cf09SDimitry Andric     std::__promote<_A1, _A2>
12279729cf09SDimitry Andric >::type
fmax(_A1 __lcpp_x,_A2 __lcpp_y)12289729cf09SDimitry Andric fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
12299729cf09SDimitry Andric {
12309729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
12319729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
12329729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1233540d2a8bSDimitry Andric     return ::fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
12349729cf09SDimitry Andric }
12359729cf09SDimitry Andric 
12369729cf09SDimitry Andric // fmin
12379729cf09SDimitry Andric 
fmin(float __lcpp_x,float __lcpp_y)1238540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fminf(__lcpp_x, __lcpp_y);}
fmin(long double __lcpp_x,long double __lcpp_y)1239540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);}
12409729cf09SDimitry Andric 
12419729cf09SDimitry Andric template <class _A1, class _A2>
12429729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
12439729cf09SDimitry Andric typename std::__lazy_enable_if
12449729cf09SDimitry Andric <
12459729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
12469729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
12479729cf09SDimitry Andric     std::__promote<_A1, _A2>
12489729cf09SDimitry Andric >::type
fmin(_A1 __lcpp_x,_A2 __lcpp_y)12499729cf09SDimitry Andric fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
12509729cf09SDimitry Andric {
12519729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
12529729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
12539729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1254540d2a8bSDimitry Andric     return ::fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
12559729cf09SDimitry Andric }
12569729cf09SDimitry Andric 
12579729cf09SDimitry Andric // hypot
12589729cf09SDimitry Andric 
hypot(float __lcpp_x,float __lcpp_y)1259540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::hypotf(__lcpp_x, __lcpp_y);}
hypot(long double __lcpp_x,long double __lcpp_y)1260540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);}
12619729cf09SDimitry Andric 
12629729cf09SDimitry Andric template <class _A1, class _A2>
12639729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
12649729cf09SDimitry Andric typename std::__lazy_enable_if
12659729cf09SDimitry Andric <
12669729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
12679729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
12689729cf09SDimitry Andric     std::__promote<_A1, _A2>
12699729cf09SDimitry Andric >::type
hypot(_A1 __lcpp_x,_A2 __lcpp_y)12709729cf09SDimitry Andric hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
12719729cf09SDimitry Andric {
12729729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
12739729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
12749729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1275540d2a8bSDimitry Andric     return ::hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
12769729cf09SDimitry Andric }
12779729cf09SDimitry Andric 
12789729cf09SDimitry Andric // ilogb
12799729cf09SDimitry Andric 
ilogb(float __lcpp_x)1280540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT       {return ::ilogbf(__lcpp_x);}
ilogb(long double __lcpp_x)1281540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);}
12829729cf09SDimitry Andric 
12839729cf09SDimitry Andric template <class _A1>
12849729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
12859729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, int>::type
ilogb(_A1 __lcpp_x)1286540d2a8bSDimitry Andric ilogb(_A1 __lcpp_x) _NOEXCEPT {return ::ilogb((double)__lcpp_x);}
12879729cf09SDimitry Andric 
12889729cf09SDimitry Andric // lgamma
12899729cf09SDimitry Andric 
lgamma(float __lcpp_x)1290540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       lgamma(float __lcpp_x) _NOEXCEPT       {return ::lgammaf(__lcpp_x);}
lgamma(long double __lcpp_x)1291540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);}
12929729cf09SDimitry Andric 
12939729cf09SDimitry Andric template <class _A1>
12949729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
12959729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
lgamma(_A1 __lcpp_x)1296540d2a8bSDimitry Andric lgamma(_A1 __lcpp_x) _NOEXCEPT {return ::lgamma((double)__lcpp_x);}
12979729cf09SDimitry Andric 
12989729cf09SDimitry Andric // llrint
12999729cf09SDimitry Andric 
llrint(float __lcpp_x)1300540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT       {return ::llrintf(__lcpp_x);}
llrint(long double __lcpp_x)1301540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return ::llrintl(__lcpp_x);}
13029729cf09SDimitry Andric 
13039729cf09SDimitry Andric template <class _A1>
13049729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13059729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long long>::type
llrint(_A1 __lcpp_x)1306540d2a8bSDimitry Andric llrint(_A1 __lcpp_x) _NOEXCEPT {return ::llrint((double)__lcpp_x);}
13079729cf09SDimitry Andric 
13089729cf09SDimitry Andric // llround
13099729cf09SDimitry Andric 
llround(float __lcpp_x)1310540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT       {return ::llroundf(__lcpp_x);}
llround(long double __lcpp_x)1311540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return ::llroundl(__lcpp_x);}
13129729cf09SDimitry Andric 
13139729cf09SDimitry Andric template <class _A1>
13149729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13159729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long long>::type
llround(_A1 __lcpp_x)1316540d2a8bSDimitry Andric llround(_A1 __lcpp_x) _NOEXCEPT {return ::llround((double)__lcpp_x);}
13179729cf09SDimitry Andric 
13189729cf09SDimitry Andric // log1p
13199729cf09SDimitry Andric 
log1p(float __lcpp_x)1320540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       log1p(float __lcpp_x) _NOEXCEPT       {return ::log1pf(__lcpp_x);}
log1p(long double __lcpp_x)1321540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);}
13229729cf09SDimitry Andric 
13239729cf09SDimitry Andric template <class _A1>
13249729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13259729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
log1p(_A1 __lcpp_x)1326540d2a8bSDimitry Andric log1p(_A1 __lcpp_x) _NOEXCEPT {return ::log1p((double)__lcpp_x);}
13279729cf09SDimitry Andric 
13289729cf09SDimitry Andric // log2
13299729cf09SDimitry Andric 
log2(float __lcpp_x)1330540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       log2(float __lcpp_x) _NOEXCEPT       {return ::log2f(__lcpp_x);}
log2(long double __lcpp_x)1331540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);}
13329729cf09SDimitry Andric 
13339729cf09SDimitry Andric template <class _A1>
13349729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13359729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
log2(_A1 __lcpp_x)1336540d2a8bSDimitry Andric log2(_A1 __lcpp_x) _NOEXCEPT {return ::log2((double)__lcpp_x);}
13379729cf09SDimitry Andric 
13389729cf09SDimitry Andric // logb
13399729cf09SDimitry Andric 
logb(float __lcpp_x)1340540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       logb(float __lcpp_x) _NOEXCEPT       {return ::logbf(__lcpp_x);}
logb(long double __lcpp_x)1341540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);}
13429729cf09SDimitry Andric 
13439729cf09SDimitry Andric template <class _A1>
13449729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13459729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
logb(_A1 __lcpp_x)1346540d2a8bSDimitry Andric logb(_A1 __lcpp_x) _NOEXCEPT {return ::logb((double)__lcpp_x);}
13479729cf09SDimitry Andric 
13489729cf09SDimitry Andric // lrint
13499729cf09SDimitry Andric 
lrint(float __lcpp_x)1350540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT       {return ::lrintf(__lcpp_x);}
lrint(long double __lcpp_x)1351540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return ::lrintl(__lcpp_x);}
13529729cf09SDimitry Andric 
13539729cf09SDimitry Andric template <class _A1>
13549729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13559729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long>::type
lrint(_A1 __lcpp_x)1356540d2a8bSDimitry Andric lrint(_A1 __lcpp_x) _NOEXCEPT {return ::lrint((double)__lcpp_x);}
13579729cf09SDimitry Andric 
13589729cf09SDimitry Andric // lround
13599729cf09SDimitry Andric 
lround(float __lcpp_x)1360540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT       {return ::lroundf(__lcpp_x);}
lround(long double __lcpp_x)1361540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return ::lroundl(__lcpp_x);}
13629729cf09SDimitry Andric 
13639729cf09SDimitry Andric template <class _A1>
13649729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13659729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long>::type
lround(_A1 __lcpp_x)1366540d2a8bSDimitry Andric lround(_A1 __lcpp_x) _NOEXCEPT {return ::lround((double)__lcpp_x);}
13679729cf09SDimitry Andric 
13689729cf09SDimitry Andric // nan
13699729cf09SDimitry Andric 
13709729cf09SDimitry Andric // nearbyint
13719729cf09SDimitry Andric 
nearbyint(float __lcpp_x)1372540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       nearbyint(float __lcpp_x) _NOEXCEPT       {return ::nearbyintf(__lcpp_x);}
nearbyint(long double __lcpp_x)1373540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);}
13749729cf09SDimitry Andric 
13759729cf09SDimitry Andric template <class _A1>
13769729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13779729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
nearbyint(_A1 __lcpp_x)1378540d2a8bSDimitry Andric nearbyint(_A1 __lcpp_x) _NOEXCEPT {return ::nearbyint((double)__lcpp_x);}
13799729cf09SDimitry Andric 
13809729cf09SDimitry Andric // nextafter
13819729cf09SDimitry Andric 
nextafter(float __lcpp_x,float __lcpp_y)1382540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::nextafterf(__lcpp_x, __lcpp_y);}
nextafter(long double __lcpp_x,long double __lcpp_y)1383540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);}
13849729cf09SDimitry Andric 
13859729cf09SDimitry Andric template <class _A1, class _A2>
13869729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
13879729cf09SDimitry Andric typename std::__lazy_enable_if
13889729cf09SDimitry Andric <
13899729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
13909729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
13919729cf09SDimitry Andric     std::__promote<_A1, _A2>
13929729cf09SDimitry Andric >::type
nextafter(_A1 __lcpp_x,_A2 __lcpp_y)13939729cf09SDimitry Andric nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
13949729cf09SDimitry Andric {
13959729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
13969729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
13979729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1398540d2a8bSDimitry Andric     return ::nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
13999729cf09SDimitry Andric }
14009729cf09SDimitry Andric 
14019729cf09SDimitry Andric // nexttoward
14029729cf09SDimitry Andric 
nexttoward(float __lcpp_x,long double __lcpp_y)1403540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT       {return ::nexttowardf(__lcpp_x, __lcpp_y);}
nexttoward(long double __lcpp_x,long double __lcpp_y)1404540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);}
14059729cf09SDimitry Andric 
14069729cf09SDimitry Andric template <class _A1>
14079729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
14089729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
nexttoward(_A1 __lcpp_x,long double __lcpp_y)1409540d2a8bSDimitry Andric nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttoward((double)__lcpp_x, __lcpp_y);}
14109729cf09SDimitry Andric 
14119729cf09SDimitry Andric // remainder
14129729cf09SDimitry Andric 
remainder(float __lcpp_x,float __lcpp_y)1413540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::remainderf(__lcpp_x, __lcpp_y);}
remainder(long double __lcpp_x,long double __lcpp_y)1414540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);}
14159729cf09SDimitry Andric 
14169729cf09SDimitry Andric template <class _A1, class _A2>
14179729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
14189729cf09SDimitry Andric typename std::__lazy_enable_if
14199729cf09SDimitry Andric <
14209729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
14219729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
14229729cf09SDimitry Andric     std::__promote<_A1, _A2>
14239729cf09SDimitry Andric >::type
remainder(_A1 __lcpp_x,_A2 __lcpp_y)14249729cf09SDimitry Andric remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
14259729cf09SDimitry Andric {
14269729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
14279729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
14289729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1429540d2a8bSDimitry Andric     return ::remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
14309729cf09SDimitry Andric }
14319729cf09SDimitry Andric 
14329729cf09SDimitry Andric // remquo
14339729cf09SDimitry Andric 
remquo(float __lcpp_x,float __lcpp_y,int * __lcpp_z)1434540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT             {return ::remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
remquo(long double __lcpp_x,long double __lcpp_y,int * __lcpp_z)1435540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
14369729cf09SDimitry Andric 
14379729cf09SDimitry Andric template <class _A1, class _A2>
14389729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
14399729cf09SDimitry Andric typename std::__lazy_enable_if
14409729cf09SDimitry Andric <
14419729cf09SDimitry Andric     std::is_arithmetic<_A1>::value &&
14429729cf09SDimitry Andric     std::is_arithmetic<_A2>::value,
14439729cf09SDimitry Andric     std::__promote<_A1, _A2>
14449729cf09SDimitry Andric >::type
remquo(_A1 __lcpp_x,_A2 __lcpp_y,int * __lcpp_z)14459729cf09SDimitry Andric remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
14469729cf09SDimitry Andric {
14479729cf09SDimitry Andric     typedef typename std::__promote<_A1, _A2>::type __result_type;
14489729cf09SDimitry Andric     static_assert((!(std::is_same<_A1, __result_type>::value &&
14499729cf09SDimitry Andric                      std::is_same<_A2, __result_type>::value)), "");
1450540d2a8bSDimitry Andric     return ::remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
14519729cf09SDimitry Andric }
14529729cf09SDimitry Andric 
14539729cf09SDimitry Andric // rint
14549729cf09SDimitry Andric 
rint(float __lcpp_x)1455540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       rint(float __lcpp_x) _NOEXCEPT       {return ::rintf(__lcpp_x);}
rint(long double __lcpp_x)1456540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return ::rintl(__lcpp_x);}
14579729cf09SDimitry Andric 
14589729cf09SDimitry Andric template <class _A1>
14599729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
14609729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
rint(_A1 __lcpp_x)1461540d2a8bSDimitry Andric rint(_A1 __lcpp_x) _NOEXCEPT {return ::rint((double)__lcpp_x);}
14629729cf09SDimitry Andric 
14639729cf09SDimitry Andric // round
14649729cf09SDimitry Andric 
round(float __lcpp_x)1465540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       round(float __lcpp_x) _NOEXCEPT       {return ::roundf(__lcpp_x);}
round(long double __lcpp_x)1466540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return ::roundl(__lcpp_x);}
14679729cf09SDimitry Andric 
14689729cf09SDimitry Andric template <class _A1>
14699729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
14709729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
round(_A1 __lcpp_x)1471540d2a8bSDimitry Andric round(_A1 __lcpp_x) _NOEXCEPT {return ::round((double)__lcpp_x);}
14729729cf09SDimitry Andric 
14739729cf09SDimitry Andric // scalbln
14749729cf09SDimitry Andric 
scalbln(float __lcpp_x,long __lcpp_y)1475540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT       {return ::scalblnf(__lcpp_x, __lcpp_y);}
scalbln(long double __lcpp_x,long __lcpp_y)1476540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);}
14779729cf09SDimitry Andric 
14789729cf09SDimitry Andric template <class _A1>
14799729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
14809729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
scalbln(_A1 __lcpp_x,long __lcpp_y)1481540d2a8bSDimitry Andric scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalbln((double)__lcpp_x, __lcpp_y);}
14829729cf09SDimitry Andric 
14839729cf09SDimitry Andric // scalbn
14849729cf09SDimitry Andric 
scalbn(float __lcpp_x,int __lcpp_y)1485540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT       {return ::scalbnf(__lcpp_x, __lcpp_y);}
scalbn(long double __lcpp_x,int __lcpp_y)1486540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);}
14879729cf09SDimitry Andric 
14889729cf09SDimitry Andric template <class _A1>
14899729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
14909729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
scalbn(_A1 __lcpp_x,int __lcpp_y)1491540d2a8bSDimitry Andric scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbn((double)__lcpp_x, __lcpp_y);}
14929729cf09SDimitry Andric 
14939729cf09SDimitry Andric // tgamma
14949729cf09SDimitry Andric 
tgamma(float __lcpp_x)1495540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       tgamma(float __lcpp_x) _NOEXCEPT       {return ::tgammaf(__lcpp_x);}
tgamma(long double __lcpp_x)1496540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);}
14979729cf09SDimitry Andric 
14989729cf09SDimitry Andric template <class _A1>
14999729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
15009729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
tgamma(_A1 __lcpp_x)1501540d2a8bSDimitry Andric tgamma(_A1 __lcpp_x) _NOEXCEPT {return ::tgamma((double)__lcpp_x);}
15029729cf09SDimitry Andric 
15039729cf09SDimitry Andric // trunc
15049729cf09SDimitry Andric 
trunc(float __lcpp_x)1505540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float       trunc(float __lcpp_x) _NOEXCEPT       {return ::truncf(__lcpp_x);}
trunc(long double __lcpp_x)1506540d2a8bSDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return ::truncl(__lcpp_x);}
15079729cf09SDimitry Andric 
15089729cf09SDimitry Andric template <class _A1>
15099729cf09SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY
15109729cf09SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type
trunc(_A1 __lcpp_x)1511540d2a8bSDimitry Andric trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);}
15129729cf09SDimitry Andric 
15139729cf09SDimitry Andric } // extern "C++"
15149729cf09SDimitry Andric 
15159729cf09SDimitry Andric #endif // __cplusplus
15169729cf09SDimitry Andric 
1517*4ba319b5SDimitry Andric #else // _LIBCPP_MATH_H
1518*4ba319b5SDimitry Andric 
1519*4ba319b5SDimitry Andric // This include lives outside the header guard in order to support an MSVC
1520*4ba319b5SDimitry Andric // extension which allows users to do:
1521*4ba319b5SDimitry Andric //
1522*4ba319b5SDimitry Andric // #define _USE_MATH_DEFINES
1523*4ba319b5SDimitry Andric // #include <math.h>
1524*4ba319b5SDimitry Andric //
1525*4ba319b5SDimitry Andric // and receive the definitions of mathematical constants, even if <math.h>
1526*4ba319b5SDimitry Andric // has previously been included.
1527*4ba319b5SDimitry Andric #if defined(_LIBCPP_MSVCRT) && defined(_USE_MATH_DEFINES)
1528*4ba319b5SDimitry Andric #include_next <math.h>
1529*4ba319b5SDimitry Andric #endif
1530*4ba319b5SDimitry Andric 
15319729cf09SDimitry Andric #endif  // _LIBCPP_MATH_H
1532