1*0b57cec5SDimitry Andric // -*- C++ -*- 2*0b57cec5SDimitry Andric //===---------------------------- math.h ----------------------------------===// 3*0b57cec5SDimitry Andric // 4*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 6*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7*0b57cec5SDimitry Andric // 8*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 9*0b57cec5SDimitry Andric 10*0b57cec5SDimitry Andric #ifndef _LIBCPP_MATH_H 11*0b57cec5SDimitry Andric #define _LIBCPP_MATH_H 12*0b57cec5SDimitry Andric 13*0b57cec5SDimitry Andric /* 14*0b57cec5SDimitry Andric math.h synopsis 15*0b57cec5SDimitry Andric 16*0b57cec5SDimitry Andric Macros: 17*0b57cec5SDimitry Andric 18*0b57cec5SDimitry Andric HUGE_VAL 19*0b57cec5SDimitry Andric HUGE_VALF // C99 20*0b57cec5SDimitry Andric HUGE_VALL // C99 21*0b57cec5SDimitry Andric INFINITY // C99 22*0b57cec5SDimitry Andric NAN // C99 23*0b57cec5SDimitry Andric FP_INFINITE // C99 24*0b57cec5SDimitry Andric FP_NAN // C99 25*0b57cec5SDimitry Andric FP_NORMAL // C99 26*0b57cec5SDimitry Andric FP_SUBNORMAL // C99 27*0b57cec5SDimitry Andric FP_ZERO // C99 28*0b57cec5SDimitry Andric FP_FAST_FMA // C99 29*0b57cec5SDimitry Andric FP_FAST_FMAF // C99 30*0b57cec5SDimitry Andric FP_FAST_FMAL // C99 31*0b57cec5SDimitry Andric FP_ILOGB0 // C99 32*0b57cec5SDimitry Andric FP_ILOGBNAN // C99 33*0b57cec5SDimitry Andric MATH_ERRNO // C99 34*0b57cec5SDimitry Andric MATH_ERREXCEPT // C99 35*0b57cec5SDimitry Andric math_errhandling // C99 36*0b57cec5SDimitry Andric 37*0b57cec5SDimitry Andric Types: 38*0b57cec5SDimitry Andric 39*0b57cec5SDimitry Andric float_t // C99 40*0b57cec5SDimitry Andric double_t // C99 41*0b57cec5SDimitry Andric 42*0b57cec5SDimitry Andric // C90 43*0b57cec5SDimitry Andric 44*0b57cec5SDimitry Andric floating_point abs(floating_point x); 45*0b57cec5SDimitry Andric 46*0b57cec5SDimitry Andric floating_point acos (arithmetic x); 47*0b57cec5SDimitry Andric float acosf(float x); 48*0b57cec5SDimitry Andric long double acosl(long double x); 49*0b57cec5SDimitry Andric 50*0b57cec5SDimitry Andric floating_point asin (arithmetic x); 51*0b57cec5SDimitry Andric float asinf(float x); 52*0b57cec5SDimitry Andric long double asinl(long double x); 53*0b57cec5SDimitry Andric 54*0b57cec5SDimitry Andric floating_point atan (arithmetic x); 55*0b57cec5SDimitry Andric float atanf(float x); 56*0b57cec5SDimitry Andric long double atanl(long double x); 57*0b57cec5SDimitry Andric 58*0b57cec5SDimitry Andric floating_point atan2 (arithmetic y, arithmetic x); 59*0b57cec5SDimitry Andric float atan2f(float y, float x); 60*0b57cec5SDimitry Andric long double atan2l(long double y, long double x); 61*0b57cec5SDimitry Andric 62*0b57cec5SDimitry Andric floating_point ceil (arithmetic x); 63*0b57cec5SDimitry Andric float ceilf(float x); 64*0b57cec5SDimitry Andric long double ceill(long double x); 65*0b57cec5SDimitry Andric 66*0b57cec5SDimitry Andric floating_point cos (arithmetic x); 67*0b57cec5SDimitry Andric float cosf(float x); 68*0b57cec5SDimitry Andric long double cosl(long double x); 69*0b57cec5SDimitry Andric 70*0b57cec5SDimitry Andric floating_point cosh (arithmetic x); 71*0b57cec5SDimitry Andric float coshf(float x); 72*0b57cec5SDimitry Andric long double coshl(long double x); 73*0b57cec5SDimitry Andric 74*0b57cec5SDimitry Andric floating_point exp (arithmetic x); 75*0b57cec5SDimitry Andric float expf(float x); 76*0b57cec5SDimitry Andric long double expl(long double x); 77*0b57cec5SDimitry Andric 78*0b57cec5SDimitry Andric floating_point fabs (arithmetic x); 79*0b57cec5SDimitry Andric float fabsf(float x); 80*0b57cec5SDimitry Andric long double fabsl(long double x); 81*0b57cec5SDimitry Andric 82*0b57cec5SDimitry Andric floating_point floor (arithmetic x); 83*0b57cec5SDimitry Andric float floorf(float x); 84*0b57cec5SDimitry Andric long double floorl(long double x); 85*0b57cec5SDimitry Andric 86*0b57cec5SDimitry Andric floating_point fmod (arithmetic x, arithmetic y); 87*0b57cec5SDimitry Andric float fmodf(float x, float y); 88*0b57cec5SDimitry Andric long double fmodl(long double x, long double y); 89*0b57cec5SDimitry Andric 90*0b57cec5SDimitry Andric floating_point frexp (arithmetic value, int* exp); 91*0b57cec5SDimitry Andric float frexpf(float value, int* exp); 92*0b57cec5SDimitry Andric long double frexpl(long double value, int* exp); 93*0b57cec5SDimitry Andric 94*0b57cec5SDimitry Andric floating_point ldexp (arithmetic value, int exp); 95*0b57cec5SDimitry Andric float ldexpf(float value, int exp); 96*0b57cec5SDimitry Andric long double ldexpl(long double value, int exp); 97*0b57cec5SDimitry Andric 98*0b57cec5SDimitry Andric floating_point log (arithmetic x); 99*0b57cec5SDimitry Andric float logf(float x); 100*0b57cec5SDimitry Andric long double logl(long double x); 101*0b57cec5SDimitry Andric 102*0b57cec5SDimitry Andric floating_point log10 (arithmetic x); 103*0b57cec5SDimitry Andric float log10f(float x); 104*0b57cec5SDimitry Andric long double log10l(long double x); 105*0b57cec5SDimitry Andric 106*0b57cec5SDimitry Andric floating_point modf (floating_point value, floating_point* iptr); 107*0b57cec5SDimitry Andric float modff(float value, float* iptr); 108*0b57cec5SDimitry Andric long double modfl(long double value, long double* iptr); 109*0b57cec5SDimitry Andric 110*0b57cec5SDimitry Andric floating_point pow (arithmetic x, arithmetic y); 111*0b57cec5SDimitry Andric float powf(float x, float y); 112*0b57cec5SDimitry Andric long double powl(long double x, long double y); 113*0b57cec5SDimitry Andric 114*0b57cec5SDimitry Andric floating_point sin (arithmetic x); 115*0b57cec5SDimitry Andric float sinf(float x); 116*0b57cec5SDimitry Andric long double sinl(long double x); 117*0b57cec5SDimitry Andric 118*0b57cec5SDimitry Andric floating_point sinh (arithmetic x); 119*0b57cec5SDimitry Andric float sinhf(float x); 120*0b57cec5SDimitry Andric long double sinhl(long double x); 121*0b57cec5SDimitry Andric 122*0b57cec5SDimitry Andric floating_point sqrt (arithmetic x); 123*0b57cec5SDimitry Andric float sqrtf(float x); 124*0b57cec5SDimitry Andric long double sqrtl(long double x); 125*0b57cec5SDimitry Andric 126*0b57cec5SDimitry Andric floating_point tan (arithmetic x); 127*0b57cec5SDimitry Andric float tanf(float x); 128*0b57cec5SDimitry Andric long double tanl(long double x); 129*0b57cec5SDimitry Andric 130*0b57cec5SDimitry Andric floating_point tanh (arithmetic x); 131*0b57cec5SDimitry Andric float tanhf(float x); 132*0b57cec5SDimitry Andric long double tanhl(long double x); 133*0b57cec5SDimitry Andric 134*0b57cec5SDimitry Andric // C99 135*0b57cec5SDimitry Andric 136*0b57cec5SDimitry Andric bool signbit(arithmetic x); 137*0b57cec5SDimitry Andric 138*0b57cec5SDimitry Andric int fpclassify(arithmetic x); 139*0b57cec5SDimitry Andric 140*0b57cec5SDimitry Andric bool isfinite(arithmetic x); 141*0b57cec5SDimitry Andric bool isinf(arithmetic x); 142*0b57cec5SDimitry Andric bool isnan(arithmetic x); 143*0b57cec5SDimitry Andric bool isnormal(arithmetic x); 144*0b57cec5SDimitry Andric 145*0b57cec5SDimitry Andric bool isgreater(arithmetic x, arithmetic y); 146*0b57cec5SDimitry Andric bool isgreaterequal(arithmetic x, arithmetic y); 147*0b57cec5SDimitry Andric bool isless(arithmetic x, arithmetic y); 148*0b57cec5SDimitry Andric bool islessequal(arithmetic x, arithmetic y); 149*0b57cec5SDimitry Andric bool islessgreater(arithmetic x, arithmetic y); 150*0b57cec5SDimitry Andric bool isunordered(arithmetic x, arithmetic y); 151*0b57cec5SDimitry Andric 152*0b57cec5SDimitry Andric floating_point acosh (arithmetic x); 153*0b57cec5SDimitry Andric float acoshf(float x); 154*0b57cec5SDimitry Andric long double acoshl(long double x); 155*0b57cec5SDimitry Andric 156*0b57cec5SDimitry Andric floating_point asinh (arithmetic x); 157*0b57cec5SDimitry Andric float asinhf(float x); 158*0b57cec5SDimitry Andric long double asinhl(long double x); 159*0b57cec5SDimitry Andric 160*0b57cec5SDimitry Andric floating_point atanh (arithmetic x); 161*0b57cec5SDimitry Andric float atanhf(float x); 162*0b57cec5SDimitry Andric long double atanhl(long double x); 163*0b57cec5SDimitry Andric 164*0b57cec5SDimitry Andric floating_point cbrt (arithmetic x); 165*0b57cec5SDimitry Andric float cbrtf(float x); 166*0b57cec5SDimitry Andric long double cbrtl(long double x); 167*0b57cec5SDimitry Andric 168*0b57cec5SDimitry Andric floating_point copysign (arithmetic x, arithmetic y); 169*0b57cec5SDimitry Andric float copysignf(float x, float y); 170*0b57cec5SDimitry Andric long double copysignl(long double x, long double y); 171*0b57cec5SDimitry Andric 172*0b57cec5SDimitry Andric floating_point erf (arithmetic x); 173*0b57cec5SDimitry Andric float erff(float x); 174*0b57cec5SDimitry Andric long double erfl(long double x); 175*0b57cec5SDimitry Andric 176*0b57cec5SDimitry Andric floating_point erfc (arithmetic x); 177*0b57cec5SDimitry Andric float erfcf(float x); 178*0b57cec5SDimitry Andric long double erfcl(long double x); 179*0b57cec5SDimitry Andric 180*0b57cec5SDimitry Andric floating_point exp2 (arithmetic x); 181*0b57cec5SDimitry Andric float exp2f(float x); 182*0b57cec5SDimitry Andric long double exp2l(long double x); 183*0b57cec5SDimitry Andric 184*0b57cec5SDimitry Andric floating_point expm1 (arithmetic x); 185*0b57cec5SDimitry Andric float expm1f(float x); 186*0b57cec5SDimitry Andric long double expm1l(long double x); 187*0b57cec5SDimitry Andric 188*0b57cec5SDimitry Andric floating_point fdim (arithmetic x, arithmetic y); 189*0b57cec5SDimitry Andric float fdimf(float x, float y); 190*0b57cec5SDimitry Andric long double fdiml(long double x, long double y); 191*0b57cec5SDimitry Andric 192*0b57cec5SDimitry Andric floating_point fma (arithmetic x, arithmetic y, arithmetic z); 193*0b57cec5SDimitry Andric float fmaf(float x, float y, float z); 194*0b57cec5SDimitry Andric long double fmal(long double x, long double y, long double z); 195*0b57cec5SDimitry Andric 196*0b57cec5SDimitry Andric floating_point fmax (arithmetic x, arithmetic y); 197*0b57cec5SDimitry Andric float fmaxf(float x, float y); 198*0b57cec5SDimitry Andric long double fmaxl(long double x, long double y); 199*0b57cec5SDimitry Andric 200*0b57cec5SDimitry Andric floating_point fmin (arithmetic x, arithmetic y); 201*0b57cec5SDimitry Andric float fminf(float x, float y); 202*0b57cec5SDimitry Andric long double fminl(long double x, long double y); 203*0b57cec5SDimitry Andric 204*0b57cec5SDimitry Andric floating_point hypot (arithmetic x, arithmetic y); 205*0b57cec5SDimitry Andric float hypotf(float x, float y); 206*0b57cec5SDimitry Andric long double hypotl(long double x, long double y); 207*0b57cec5SDimitry Andric 208*0b57cec5SDimitry Andric int ilogb (arithmetic x); 209*0b57cec5SDimitry Andric int ilogbf(float x); 210*0b57cec5SDimitry Andric int ilogbl(long double x); 211*0b57cec5SDimitry Andric 212*0b57cec5SDimitry Andric floating_point lgamma (arithmetic x); 213*0b57cec5SDimitry Andric float lgammaf(float x); 214*0b57cec5SDimitry Andric long double lgammal(long double x); 215*0b57cec5SDimitry Andric 216*0b57cec5SDimitry Andric long long llrint (arithmetic x); 217*0b57cec5SDimitry Andric long long llrintf(float x); 218*0b57cec5SDimitry Andric long long llrintl(long double x); 219*0b57cec5SDimitry Andric 220*0b57cec5SDimitry Andric long long llround (arithmetic x); 221*0b57cec5SDimitry Andric long long llroundf(float x); 222*0b57cec5SDimitry Andric long long llroundl(long double x); 223*0b57cec5SDimitry Andric 224*0b57cec5SDimitry Andric floating_point log1p (arithmetic x); 225*0b57cec5SDimitry Andric float log1pf(float x); 226*0b57cec5SDimitry Andric long double log1pl(long double x); 227*0b57cec5SDimitry Andric 228*0b57cec5SDimitry Andric floating_point log2 (arithmetic x); 229*0b57cec5SDimitry Andric float log2f(float x); 230*0b57cec5SDimitry Andric long double log2l(long double x); 231*0b57cec5SDimitry Andric 232*0b57cec5SDimitry Andric floating_point logb (arithmetic x); 233*0b57cec5SDimitry Andric float logbf(float x); 234*0b57cec5SDimitry Andric long double logbl(long double x); 235*0b57cec5SDimitry Andric 236*0b57cec5SDimitry Andric long lrint (arithmetic x); 237*0b57cec5SDimitry Andric long lrintf(float x); 238*0b57cec5SDimitry Andric long lrintl(long double x); 239*0b57cec5SDimitry Andric 240*0b57cec5SDimitry Andric long lround (arithmetic x); 241*0b57cec5SDimitry Andric long lroundf(float x); 242*0b57cec5SDimitry Andric long lroundl(long double x); 243*0b57cec5SDimitry Andric 244*0b57cec5SDimitry Andric double nan (const char* str); 245*0b57cec5SDimitry Andric float nanf(const char* str); 246*0b57cec5SDimitry Andric long double nanl(const char* str); 247*0b57cec5SDimitry Andric 248*0b57cec5SDimitry Andric floating_point nearbyint (arithmetic x); 249*0b57cec5SDimitry Andric float nearbyintf(float x); 250*0b57cec5SDimitry Andric long double nearbyintl(long double x); 251*0b57cec5SDimitry Andric 252*0b57cec5SDimitry Andric floating_point nextafter (arithmetic x, arithmetic y); 253*0b57cec5SDimitry Andric float nextafterf(float x, float y); 254*0b57cec5SDimitry Andric long double nextafterl(long double x, long double y); 255*0b57cec5SDimitry Andric 256*0b57cec5SDimitry Andric floating_point nexttoward (arithmetic x, long double y); 257*0b57cec5SDimitry Andric float nexttowardf(float x, long double y); 258*0b57cec5SDimitry Andric long double nexttowardl(long double x, long double y); 259*0b57cec5SDimitry Andric 260*0b57cec5SDimitry Andric floating_point remainder (arithmetic x, arithmetic y); 261*0b57cec5SDimitry Andric float remainderf(float x, float y); 262*0b57cec5SDimitry Andric long double remainderl(long double x, long double y); 263*0b57cec5SDimitry Andric 264*0b57cec5SDimitry Andric floating_point remquo (arithmetic x, arithmetic y, int* pquo); 265*0b57cec5SDimitry Andric float remquof(float x, float y, int* pquo); 266*0b57cec5SDimitry Andric long double remquol(long double x, long double y, int* pquo); 267*0b57cec5SDimitry Andric 268*0b57cec5SDimitry Andric floating_point rint (arithmetic x); 269*0b57cec5SDimitry Andric float rintf(float x); 270*0b57cec5SDimitry Andric long double rintl(long double x); 271*0b57cec5SDimitry Andric 272*0b57cec5SDimitry Andric floating_point round (arithmetic x); 273*0b57cec5SDimitry Andric float roundf(float x); 274*0b57cec5SDimitry Andric long double roundl(long double x); 275*0b57cec5SDimitry Andric 276*0b57cec5SDimitry Andric floating_point scalbln (arithmetic x, long ex); 277*0b57cec5SDimitry Andric float scalblnf(float x, long ex); 278*0b57cec5SDimitry Andric long double scalblnl(long double x, long ex); 279*0b57cec5SDimitry Andric 280*0b57cec5SDimitry Andric floating_point scalbn (arithmetic x, int ex); 281*0b57cec5SDimitry Andric float scalbnf(float x, int ex); 282*0b57cec5SDimitry Andric long double scalbnl(long double x, int ex); 283*0b57cec5SDimitry Andric 284*0b57cec5SDimitry Andric floating_point tgamma (arithmetic x); 285*0b57cec5SDimitry Andric float tgammaf(float x); 286*0b57cec5SDimitry Andric long double tgammal(long double x); 287*0b57cec5SDimitry Andric 288*0b57cec5SDimitry Andric floating_point trunc (arithmetic x); 289*0b57cec5SDimitry Andric float truncf(float x); 290*0b57cec5SDimitry Andric long double truncl(long double x); 291*0b57cec5SDimitry Andric 292*0b57cec5SDimitry Andric */ 293*0b57cec5SDimitry Andric 294*0b57cec5SDimitry Andric #include <__config> 295*0b57cec5SDimitry Andric 296*0b57cec5SDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 297*0b57cec5SDimitry Andric #pragma GCC system_header 298*0b57cec5SDimitry Andric #endif 299*0b57cec5SDimitry Andric 300*0b57cec5SDimitry Andric #define _LIBCPP_STDLIB_INCLUDE_NEXT 301*0b57cec5SDimitry Andric #include <stdlib.h> 302*0b57cec5SDimitry Andric 303*0b57cec5SDimitry Andric #include_next <math.h> 304*0b57cec5SDimitry Andric 305*0b57cec5SDimitry Andric #ifdef __cplusplus 306*0b57cec5SDimitry Andric 307*0b57cec5SDimitry Andric // We support including .h headers inside 'extern "C"' contexts, so switch 308*0b57cec5SDimitry Andric // back to C++ linkage before including these C++ headers. 309*0b57cec5SDimitry Andric extern "C++" { 310*0b57cec5SDimitry Andric 311*0b57cec5SDimitry Andric #include <type_traits> 312*0b57cec5SDimitry Andric #include <limits> 313*0b57cec5SDimitry Andric 314*0b57cec5SDimitry Andric // signbit 315*0b57cec5SDimitry Andric 316*0b57cec5SDimitry Andric #ifdef signbit 317*0b57cec5SDimitry Andric 318*0b57cec5SDimitry Andric template <class _A1> 319*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 320*0b57cec5SDimitry Andric bool 321*0b57cec5SDimitry Andric __libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT 322*0b57cec5SDimitry Andric { 323*0b57cec5SDimitry Andric return signbit(__lcpp_x); 324*0b57cec5SDimitry Andric } 325*0b57cec5SDimitry Andric 326*0b57cec5SDimitry Andric #undef signbit 327*0b57cec5SDimitry Andric 328*0b57cec5SDimitry Andric template <class _A1> 329*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 330*0b57cec5SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 331*0b57cec5SDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT 332*0b57cec5SDimitry Andric { 333*0b57cec5SDimitry Andric return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x); 334*0b57cec5SDimitry Andric } 335*0b57cec5SDimitry Andric 336*0b57cec5SDimitry Andric template <class _A1> 337*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 338*0b57cec5SDimitry Andric typename std::enable_if< 339*0b57cec5SDimitry Andric std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type 340*0b57cec5SDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT 341*0b57cec5SDimitry Andric { return __lcpp_x < 0; } 342*0b57cec5SDimitry Andric 343*0b57cec5SDimitry Andric template <class _A1> 344*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 345*0b57cec5SDimitry Andric typename std::enable_if< 346*0b57cec5SDimitry Andric std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type 347*0b57cec5SDimitry Andric signbit(_A1) _NOEXCEPT 348*0b57cec5SDimitry Andric { return false; } 349*0b57cec5SDimitry Andric 350*0b57cec5SDimitry Andric #elif defined(_LIBCPP_MSVCRT) 351*0b57cec5SDimitry Andric 352*0b57cec5SDimitry Andric template <typename _A1> 353*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 354*0b57cec5SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 355*0b57cec5SDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT 356*0b57cec5SDimitry Andric { 357*0b57cec5SDimitry Andric return ::signbit(static_cast<typename std::__promote<_A1>::type>(__lcpp_x)); 358*0b57cec5SDimitry Andric } 359*0b57cec5SDimitry Andric 360*0b57cec5SDimitry Andric template <class _A1> 361*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 362*0b57cec5SDimitry Andric typename std::enable_if< 363*0b57cec5SDimitry Andric std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type 364*0b57cec5SDimitry Andric signbit(_A1 __lcpp_x) _NOEXCEPT 365*0b57cec5SDimitry Andric { return __lcpp_x < 0; } 366*0b57cec5SDimitry Andric 367*0b57cec5SDimitry Andric template <class _A1> 368*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 369*0b57cec5SDimitry Andric typename std::enable_if< 370*0b57cec5SDimitry Andric std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type 371*0b57cec5SDimitry Andric signbit(_A1) _NOEXCEPT 372*0b57cec5SDimitry Andric { return false; } 373*0b57cec5SDimitry Andric 374*0b57cec5SDimitry Andric #endif // signbit 375*0b57cec5SDimitry Andric 376*0b57cec5SDimitry Andric // fpclassify 377*0b57cec5SDimitry Andric 378*0b57cec5SDimitry Andric #ifdef fpclassify 379*0b57cec5SDimitry Andric 380*0b57cec5SDimitry Andric template <class _A1> 381*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 382*0b57cec5SDimitry Andric int 383*0b57cec5SDimitry Andric __libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT 384*0b57cec5SDimitry Andric { 385*0b57cec5SDimitry Andric return fpclassify(__lcpp_x); 386*0b57cec5SDimitry Andric } 387*0b57cec5SDimitry Andric 388*0b57cec5SDimitry Andric #undef fpclassify 389*0b57cec5SDimitry Andric 390*0b57cec5SDimitry Andric template <class _A1> 391*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 392*0b57cec5SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, int>::type 393*0b57cec5SDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT 394*0b57cec5SDimitry Andric { 395*0b57cec5SDimitry Andric return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x); 396*0b57cec5SDimitry Andric } 397*0b57cec5SDimitry Andric 398*0b57cec5SDimitry Andric template <class _A1> 399*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 400*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, int>::type 401*0b57cec5SDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT 402*0b57cec5SDimitry Andric { return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; } 403*0b57cec5SDimitry Andric 404*0b57cec5SDimitry Andric #elif defined(_LIBCPP_MSVCRT) 405*0b57cec5SDimitry Andric 406*0b57cec5SDimitry Andric template <typename _A1> 407*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 408*0b57cec5SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 409*0b57cec5SDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT 410*0b57cec5SDimitry Andric { 411*0b57cec5SDimitry Andric return ::fpclassify(static_cast<typename std::__promote<_A1>::type>(__lcpp_x)); 412*0b57cec5SDimitry Andric } 413*0b57cec5SDimitry Andric 414*0b57cec5SDimitry Andric template <class _A1> 415*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 416*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, int>::type 417*0b57cec5SDimitry Andric fpclassify(_A1 __lcpp_x) _NOEXCEPT 418*0b57cec5SDimitry Andric { return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; } 419*0b57cec5SDimitry Andric 420*0b57cec5SDimitry Andric #endif // fpclassify 421*0b57cec5SDimitry Andric 422*0b57cec5SDimitry Andric // isfinite 423*0b57cec5SDimitry Andric 424*0b57cec5SDimitry Andric #ifdef isfinite 425*0b57cec5SDimitry Andric 426*0b57cec5SDimitry Andric template <class _A1> 427*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 428*0b57cec5SDimitry Andric bool 429*0b57cec5SDimitry Andric __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT 430*0b57cec5SDimitry Andric { 431*0b57cec5SDimitry Andric return isfinite(__lcpp_x); 432*0b57cec5SDimitry Andric } 433*0b57cec5SDimitry Andric 434*0b57cec5SDimitry Andric #undef isfinite 435*0b57cec5SDimitry Andric 436*0b57cec5SDimitry Andric template <class _A1> 437*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 438*0b57cec5SDimitry Andric typename std::enable_if< 439*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, 440*0b57cec5SDimitry Andric bool>::type 441*0b57cec5SDimitry Andric isfinite(_A1 __lcpp_x) _NOEXCEPT 442*0b57cec5SDimitry Andric { 443*0b57cec5SDimitry Andric return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x); 444*0b57cec5SDimitry Andric } 445*0b57cec5SDimitry Andric 446*0b57cec5SDimitry Andric template <class _A1> 447*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 448*0b57cec5SDimitry Andric typename std::enable_if< 449*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, 450*0b57cec5SDimitry Andric bool>::type 451*0b57cec5SDimitry Andric isfinite(_A1) _NOEXCEPT 452*0b57cec5SDimitry Andric { return true; } 453*0b57cec5SDimitry Andric 454*0b57cec5SDimitry Andric #endif // isfinite 455*0b57cec5SDimitry Andric 456*0b57cec5SDimitry Andric // isinf 457*0b57cec5SDimitry Andric 458*0b57cec5SDimitry Andric #ifdef isinf 459*0b57cec5SDimitry Andric 460*0b57cec5SDimitry Andric template <class _A1> 461*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 462*0b57cec5SDimitry Andric bool 463*0b57cec5SDimitry Andric __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT 464*0b57cec5SDimitry Andric { 465*0b57cec5SDimitry Andric return isinf(__lcpp_x); 466*0b57cec5SDimitry Andric } 467*0b57cec5SDimitry Andric 468*0b57cec5SDimitry Andric #undef isinf 469*0b57cec5SDimitry Andric 470*0b57cec5SDimitry Andric template <class _A1> 471*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 472*0b57cec5SDimitry Andric typename std::enable_if< 473*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, 474*0b57cec5SDimitry Andric bool>::type 475*0b57cec5SDimitry Andric isinf(_A1 __lcpp_x) _NOEXCEPT 476*0b57cec5SDimitry Andric { 477*0b57cec5SDimitry Andric return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x); 478*0b57cec5SDimitry Andric } 479*0b57cec5SDimitry Andric 480*0b57cec5SDimitry Andric template <class _A1> 481*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 482*0b57cec5SDimitry Andric typename std::enable_if< 483*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, 484*0b57cec5SDimitry Andric bool>::type 485*0b57cec5SDimitry Andric isinf(_A1) _NOEXCEPT 486*0b57cec5SDimitry Andric { return false; } 487*0b57cec5SDimitry Andric 488*0b57cec5SDimitry Andric #ifdef _LIBCPP_PREFERRED_OVERLOAD 489*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 490*0b57cec5SDimitry Andric bool 491*0b57cec5SDimitry Andric isinf(float __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } 492*0b57cec5SDimitry Andric 493*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD 494*0b57cec5SDimitry Andric bool 495*0b57cec5SDimitry Andric isinf(double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } 496*0b57cec5SDimitry Andric 497*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 498*0b57cec5SDimitry Andric bool 499*0b57cec5SDimitry Andric isinf(long double __lcpp_x) _NOEXCEPT { return __libcpp_isinf(__lcpp_x); } 500*0b57cec5SDimitry Andric #endif 501*0b57cec5SDimitry Andric 502*0b57cec5SDimitry Andric #endif // isinf 503*0b57cec5SDimitry Andric 504*0b57cec5SDimitry Andric // isnan 505*0b57cec5SDimitry Andric 506*0b57cec5SDimitry Andric #ifdef isnan 507*0b57cec5SDimitry Andric 508*0b57cec5SDimitry Andric template <class _A1> 509*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 510*0b57cec5SDimitry Andric bool 511*0b57cec5SDimitry Andric __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT 512*0b57cec5SDimitry Andric { 513*0b57cec5SDimitry Andric return isnan(__lcpp_x); 514*0b57cec5SDimitry Andric } 515*0b57cec5SDimitry Andric 516*0b57cec5SDimitry Andric #undef isnan 517*0b57cec5SDimitry Andric 518*0b57cec5SDimitry Andric template <class _A1> 519*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 520*0b57cec5SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 521*0b57cec5SDimitry Andric isnan(_A1 __lcpp_x) _NOEXCEPT 522*0b57cec5SDimitry Andric { 523*0b57cec5SDimitry Andric return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x); 524*0b57cec5SDimitry Andric } 525*0b57cec5SDimitry Andric 526*0b57cec5SDimitry Andric template <class _A1> 527*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 528*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, bool>::type 529*0b57cec5SDimitry Andric isnan(_A1) _NOEXCEPT 530*0b57cec5SDimitry Andric { return false; } 531*0b57cec5SDimitry Andric 532*0b57cec5SDimitry Andric #ifdef _LIBCPP_PREFERRED_OVERLOAD 533*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 534*0b57cec5SDimitry Andric bool 535*0b57cec5SDimitry Andric isnan(float __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } 536*0b57cec5SDimitry Andric 537*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD 538*0b57cec5SDimitry Andric bool 539*0b57cec5SDimitry Andric isnan(double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } 540*0b57cec5SDimitry Andric 541*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 542*0b57cec5SDimitry Andric bool 543*0b57cec5SDimitry Andric isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } 544*0b57cec5SDimitry Andric #endif 545*0b57cec5SDimitry Andric 546*0b57cec5SDimitry Andric #endif // isnan 547*0b57cec5SDimitry Andric 548*0b57cec5SDimitry Andric // isnormal 549*0b57cec5SDimitry Andric 550*0b57cec5SDimitry Andric #ifdef isnormal 551*0b57cec5SDimitry Andric 552*0b57cec5SDimitry Andric template <class _A1> 553*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 554*0b57cec5SDimitry Andric bool 555*0b57cec5SDimitry Andric __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT 556*0b57cec5SDimitry Andric { 557*0b57cec5SDimitry Andric return isnormal(__lcpp_x); 558*0b57cec5SDimitry Andric } 559*0b57cec5SDimitry Andric 560*0b57cec5SDimitry Andric #undef isnormal 561*0b57cec5SDimitry Andric 562*0b57cec5SDimitry Andric template <class _A1> 563*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 564*0b57cec5SDimitry Andric typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 565*0b57cec5SDimitry Andric isnormal(_A1 __lcpp_x) _NOEXCEPT 566*0b57cec5SDimitry Andric { 567*0b57cec5SDimitry Andric return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x); 568*0b57cec5SDimitry Andric } 569*0b57cec5SDimitry Andric 570*0b57cec5SDimitry Andric template <class _A1> 571*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 572*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, bool>::type 573*0b57cec5SDimitry Andric isnormal(_A1 __lcpp_x) _NOEXCEPT 574*0b57cec5SDimitry Andric { return __lcpp_x != 0; } 575*0b57cec5SDimitry Andric 576*0b57cec5SDimitry Andric #endif // isnormal 577*0b57cec5SDimitry Andric 578*0b57cec5SDimitry Andric // isgreater 579*0b57cec5SDimitry Andric 580*0b57cec5SDimitry Andric #ifdef isgreater 581*0b57cec5SDimitry Andric 582*0b57cec5SDimitry Andric template <class _A1, class _A2> 583*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 584*0b57cec5SDimitry Andric bool 585*0b57cec5SDimitry Andric __libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 586*0b57cec5SDimitry Andric { 587*0b57cec5SDimitry Andric return isgreater(__lcpp_x, __lcpp_y); 588*0b57cec5SDimitry Andric } 589*0b57cec5SDimitry Andric 590*0b57cec5SDimitry Andric #undef isgreater 591*0b57cec5SDimitry Andric 592*0b57cec5SDimitry Andric template <class _A1, class _A2> 593*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 594*0b57cec5SDimitry Andric typename std::enable_if 595*0b57cec5SDimitry Andric < 596*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 597*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 598*0b57cec5SDimitry Andric bool 599*0b57cec5SDimitry Andric >::type 600*0b57cec5SDimitry Andric isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 601*0b57cec5SDimitry Andric { 602*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type type; 603*0b57cec5SDimitry Andric return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y); 604*0b57cec5SDimitry Andric } 605*0b57cec5SDimitry Andric 606*0b57cec5SDimitry Andric #endif // isgreater 607*0b57cec5SDimitry Andric 608*0b57cec5SDimitry Andric // isgreaterequal 609*0b57cec5SDimitry Andric 610*0b57cec5SDimitry Andric #ifdef isgreaterequal 611*0b57cec5SDimitry Andric 612*0b57cec5SDimitry Andric template <class _A1, class _A2> 613*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 614*0b57cec5SDimitry Andric bool 615*0b57cec5SDimitry Andric __libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 616*0b57cec5SDimitry Andric { 617*0b57cec5SDimitry Andric return isgreaterequal(__lcpp_x, __lcpp_y); 618*0b57cec5SDimitry Andric } 619*0b57cec5SDimitry Andric 620*0b57cec5SDimitry Andric #undef isgreaterequal 621*0b57cec5SDimitry Andric 622*0b57cec5SDimitry Andric template <class _A1, class _A2> 623*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 624*0b57cec5SDimitry Andric typename std::enable_if 625*0b57cec5SDimitry Andric < 626*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 627*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 628*0b57cec5SDimitry Andric bool 629*0b57cec5SDimitry Andric >::type 630*0b57cec5SDimitry Andric isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 631*0b57cec5SDimitry Andric { 632*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type type; 633*0b57cec5SDimitry Andric return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y); 634*0b57cec5SDimitry Andric } 635*0b57cec5SDimitry Andric 636*0b57cec5SDimitry Andric #endif // isgreaterequal 637*0b57cec5SDimitry Andric 638*0b57cec5SDimitry Andric // isless 639*0b57cec5SDimitry Andric 640*0b57cec5SDimitry Andric #ifdef isless 641*0b57cec5SDimitry Andric 642*0b57cec5SDimitry Andric template <class _A1, class _A2> 643*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 644*0b57cec5SDimitry Andric bool 645*0b57cec5SDimitry Andric __libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 646*0b57cec5SDimitry Andric { 647*0b57cec5SDimitry Andric return isless(__lcpp_x, __lcpp_y); 648*0b57cec5SDimitry Andric } 649*0b57cec5SDimitry Andric 650*0b57cec5SDimitry Andric #undef isless 651*0b57cec5SDimitry Andric 652*0b57cec5SDimitry Andric template <class _A1, class _A2> 653*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 654*0b57cec5SDimitry Andric typename std::enable_if 655*0b57cec5SDimitry Andric < 656*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 657*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 658*0b57cec5SDimitry Andric bool 659*0b57cec5SDimitry Andric >::type 660*0b57cec5SDimitry Andric isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 661*0b57cec5SDimitry Andric { 662*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type type; 663*0b57cec5SDimitry Andric return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y); 664*0b57cec5SDimitry Andric } 665*0b57cec5SDimitry Andric 666*0b57cec5SDimitry Andric #endif // isless 667*0b57cec5SDimitry Andric 668*0b57cec5SDimitry Andric // islessequal 669*0b57cec5SDimitry Andric 670*0b57cec5SDimitry Andric #ifdef islessequal 671*0b57cec5SDimitry Andric 672*0b57cec5SDimitry Andric template <class _A1, class _A2> 673*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 674*0b57cec5SDimitry Andric bool 675*0b57cec5SDimitry Andric __libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 676*0b57cec5SDimitry Andric { 677*0b57cec5SDimitry Andric return islessequal(__lcpp_x, __lcpp_y); 678*0b57cec5SDimitry Andric } 679*0b57cec5SDimitry Andric 680*0b57cec5SDimitry Andric #undef islessequal 681*0b57cec5SDimitry Andric 682*0b57cec5SDimitry Andric template <class _A1, class _A2> 683*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 684*0b57cec5SDimitry Andric typename std::enable_if 685*0b57cec5SDimitry Andric < 686*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 687*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 688*0b57cec5SDimitry Andric bool 689*0b57cec5SDimitry Andric >::type 690*0b57cec5SDimitry Andric islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 691*0b57cec5SDimitry Andric { 692*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type type; 693*0b57cec5SDimitry Andric return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y); 694*0b57cec5SDimitry Andric } 695*0b57cec5SDimitry Andric 696*0b57cec5SDimitry Andric #endif // islessequal 697*0b57cec5SDimitry Andric 698*0b57cec5SDimitry Andric // islessgreater 699*0b57cec5SDimitry Andric 700*0b57cec5SDimitry Andric #ifdef islessgreater 701*0b57cec5SDimitry Andric 702*0b57cec5SDimitry Andric template <class _A1, class _A2> 703*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 704*0b57cec5SDimitry Andric bool 705*0b57cec5SDimitry Andric __libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 706*0b57cec5SDimitry Andric { 707*0b57cec5SDimitry Andric return islessgreater(__lcpp_x, __lcpp_y); 708*0b57cec5SDimitry Andric } 709*0b57cec5SDimitry Andric 710*0b57cec5SDimitry Andric #undef islessgreater 711*0b57cec5SDimitry Andric 712*0b57cec5SDimitry Andric template <class _A1, class _A2> 713*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 714*0b57cec5SDimitry Andric typename std::enable_if 715*0b57cec5SDimitry Andric < 716*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 717*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 718*0b57cec5SDimitry Andric bool 719*0b57cec5SDimitry Andric >::type 720*0b57cec5SDimitry Andric islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 721*0b57cec5SDimitry Andric { 722*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type type; 723*0b57cec5SDimitry Andric return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y); 724*0b57cec5SDimitry Andric } 725*0b57cec5SDimitry Andric 726*0b57cec5SDimitry Andric #endif // islessgreater 727*0b57cec5SDimitry Andric 728*0b57cec5SDimitry Andric // isunordered 729*0b57cec5SDimitry Andric 730*0b57cec5SDimitry Andric #ifdef isunordered 731*0b57cec5SDimitry Andric 732*0b57cec5SDimitry Andric template <class _A1, class _A2> 733*0b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 734*0b57cec5SDimitry Andric bool 735*0b57cec5SDimitry Andric __libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 736*0b57cec5SDimitry Andric { 737*0b57cec5SDimitry Andric return isunordered(__lcpp_x, __lcpp_y); 738*0b57cec5SDimitry Andric } 739*0b57cec5SDimitry Andric 740*0b57cec5SDimitry Andric #undef isunordered 741*0b57cec5SDimitry Andric 742*0b57cec5SDimitry Andric template <class _A1, class _A2> 743*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 744*0b57cec5SDimitry Andric typename std::enable_if 745*0b57cec5SDimitry Andric < 746*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 747*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 748*0b57cec5SDimitry Andric bool 749*0b57cec5SDimitry Andric >::type 750*0b57cec5SDimitry Andric isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 751*0b57cec5SDimitry Andric { 752*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type type; 753*0b57cec5SDimitry Andric return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y); 754*0b57cec5SDimitry Andric } 755*0b57cec5SDimitry Andric 756*0b57cec5SDimitry Andric #endif // isunordered 757*0b57cec5SDimitry Andric 758*0b57cec5SDimitry Andric // abs 759*0b57cec5SDimitry Andric 760*0b57cec5SDimitry Andric #undef abs 761*0b57cec5SDimitry Andric #undef labs 762*0b57cec5SDimitry Andric #ifndef _LIBCPP_HAS_NO_LONG_LONG 763*0b57cec5SDimitry Andric #undef llabs 764*0b57cec5SDimitry Andric #endif 765*0b57cec5SDimitry Andric 766*0b57cec5SDimitry Andric // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined 767*0b57cec5SDimitry Andric #if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) 768*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT { 769*0b57cec5SDimitry Andric return ::labs(__x); 770*0b57cec5SDimitry Andric } 771*0b57cec5SDimitry Andric #ifndef _LIBCPP_HAS_NO_LONG_LONG 772*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT { 773*0b57cec5SDimitry Andric return ::llabs(__x); 774*0b57cec5SDimitry Andric } 775*0b57cec5SDimitry Andric #endif // _LIBCPP_HAS_NO_LONG_LONG 776*0b57cec5SDimitry Andric #endif // !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) 777*0b57cec5SDimitry Andric 778*0b57cec5SDimitry Andric 779*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 780*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT { 781*0b57cec5SDimitry Andric return ::fabsf(__lcpp_x); 782*0b57cec5SDimitry Andric } 783*0b57cec5SDimitry Andric 784*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY double abs(double __lcpp_x) _NOEXCEPT { 785*0b57cec5SDimitry Andric return ::fabs(__lcpp_x); 786*0b57cec5SDimitry Andric } 787*0b57cec5SDimitry Andric 788*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double 789*0b57cec5SDimitry Andric abs(long double __lcpp_x) _NOEXCEPT { 790*0b57cec5SDimitry Andric return ::fabsl(__lcpp_x); 791*0b57cec5SDimitry Andric } 792*0b57cec5SDimitry Andric #endif // !(defined(_AIX) || defined(__sun__)) 793*0b57cec5SDimitry Andric 794*0b57cec5SDimitry Andric // div 795*0b57cec5SDimitry Andric 796*0b57cec5SDimitry Andric #undef div 797*0b57cec5SDimitry Andric #undef ldiv 798*0b57cec5SDimitry Andric #ifndef _LIBCPP_HAS_NO_LONG_LONG 799*0b57cec5SDimitry Andric #undef lldiv 800*0b57cec5SDimitry Andric #endif 801*0b57cec5SDimitry Andric 802*0b57cec5SDimitry Andric // MSVCRT already has the correct prototype in <stdlib.h> if __cplusplus is defined 803*0b57cec5SDimitry Andric #if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) 804*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT { 805*0b57cec5SDimitry Andric return ::ldiv(__x, __y); 806*0b57cec5SDimitry Andric } 807*0b57cec5SDimitry Andric #ifndef _LIBCPP_HAS_NO_LONG_LONG 808*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, 809*0b57cec5SDimitry Andric long long __y) _NOEXCEPT { 810*0b57cec5SDimitry Andric return ::lldiv(__x, __y); 811*0b57cec5SDimitry Andric } 812*0b57cec5SDimitry Andric #endif // _LIBCPP_HAS_NO_LONG_LONG 813*0b57cec5SDimitry Andric #endif // _LIBCPP_MSVCRT / __sun__ / _AIX 814*0b57cec5SDimitry Andric 815*0b57cec5SDimitry Andric // acos 816*0b57cec5SDimitry Andric 817*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 818*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return ::acosf(__lcpp_x);} 819*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);} 820*0b57cec5SDimitry Andric #endif 821*0b57cec5SDimitry Andric 822*0b57cec5SDimitry Andric template <class _A1> 823*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 824*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 825*0b57cec5SDimitry Andric acos(_A1 __lcpp_x) _NOEXCEPT {return ::acos((double)__lcpp_x);} 826*0b57cec5SDimitry Andric 827*0b57cec5SDimitry Andric // asin 828*0b57cec5SDimitry Andric 829*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 830*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return ::asinf(__lcpp_x);} 831*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);} 832*0b57cec5SDimitry Andric #endif 833*0b57cec5SDimitry Andric 834*0b57cec5SDimitry Andric template <class _A1> 835*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 836*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 837*0b57cec5SDimitry Andric asin(_A1 __lcpp_x) _NOEXCEPT {return ::asin((double)__lcpp_x);} 838*0b57cec5SDimitry Andric 839*0b57cec5SDimitry Andric // atan 840*0b57cec5SDimitry Andric 841*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 842*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return ::atanf(__lcpp_x);} 843*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);} 844*0b57cec5SDimitry Andric #endif 845*0b57cec5SDimitry Andric 846*0b57cec5SDimitry Andric template <class _A1> 847*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 848*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 849*0b57cec5SDimitry Andric atan(_A1 __lcpp_x) _NOEXCEPT {return ::atan((double)__lcpp_x);} 850*0b57cec5SDimitry Andric 851*0b57cec5SDimitry Andric // atan2 852*0b57cec5SDimitry Andric 853*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 854*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return ::atan2f(__lcpp_y, __lcpp_x);} 855*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);} 856*0b57cec5SDimitry Andric #endif 857*0b57cec5SDimitry Andric 858*0b57cec5SDimitry Andric template <class _A1, class _A2> 859*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 860*0b57cec5SDimitry Andric typename std::_EnableIf 861*0b57cec5SDimitry Andric < 862*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 863*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 864*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 865*0b57cec5SDimitry Andric >::type 866*0b57cec5SDimitry Andric atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT 867*0b57cec5SDimitry Andric { 868*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 869*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 870*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 871*0b57cec5SDimitry Andric return ::atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x); 872*0b57cec5SDimitry Andric } 873*0b57cec5SDimitry Andric 874*0b57cec5SDimitry Andric // ceil 875*0b57cec5SDimitry Andric 876*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 877*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ::ceilf(__lcpp_x);} 878*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);} 879*0b57cec5SDimitry Andric #endif 880*0b57cec5SDimitry Andric 881*0b57cec5SDimitry Andric template <class _A1> 882*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 883*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 884*0b57cec5SDimitry Andric ceil(_A1 __lcpp_x) _NOEXCEPT {return ::ceil((double)__lcpp_x);} 885*0b57cec5SDimitry Andric 886*0b57cec5SDimitry Andric // cos 887*0b57cec5SDimitry Andric 888*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 889*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return ::cosf(__lcpp_x);} 890*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);} 891*0b57cec5SDimitry Andric #endif 892*0b57cec5SDimitry Andric 893*0b57cec5SDimitry Andric template <class _A1> 894*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 895*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 896*0b57cec5SDimitry Andric cos(_A1 __lcpp_x) _NOEXCEPT {return ::cos((double)__lcpp_x);} 897*0b57cec5SDimitry Andric 898*0b57cec5SDimitry Andric // cosh 899*0b57cec5SDimitry Andric 900*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 901*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return ::coshf(__lcpp_x);} 902*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);} 903*0b57cec5SDimitry Andric #endif 904*0b57cec5SDimitry Andric 905*0b57cec5SDimitry Andric template <class _A1> 906*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 907*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 908*0b57cec5SDimitry Andric cosh(_A1 __lcpp_x) _NOEXCEPT {return ::cosh((double)__lcpp_x);} 909*0b57cec5SDimitry Andric 910*0b57cec5SDimitry Andric // exp 911*0b57cec5SDimitry Andric 912*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 913*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return ::expf(__lcpp_x);} 914*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);} 915*0b57cec5SDimitry Andric #endif 916*0b57cec5SDimitry Andric 917*0b57cec5SDimitry Andric template <class _A1> 918*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 919*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 920*0b57cec5SDimitry Andric exp(_A1 __lcpp_x) _NOEXCEPT {return ::exp((double)__lcpp_x);} 921*0b57cec5SDimitry Andric 922*0b57cec5SDimitry Andric // fabs 923*0b57cec5SDimitry Andric 924*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 925*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);} 926*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);} 927*0b57cec5SDimitry Andric #endif 928*0b57cec5SDimitry Andric 929*0b57cec5SDimitry Andric template <class _A1> 930*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 931*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 932*0b57cec5SDimitry Andric fabs(_A1 __lcpp_x) _NOEXCEPT {return ::fabs((double)__lcpp_x);} 933*0b57cec5SDimitry Andric 934*0b57cec5SDimitry Andric // floor 935*0b57cec5SDimitry Andric 936*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 937*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return ::floorf(__lcpp_x);} 938*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);} 939*0b57cec5SDimitry Andric #endif 940*0b57cec5SDimitry Andric 941*0b57cec5SDimitry Andric template <class _A1> 942*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 943*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 944*0b57cec5SDimitry Andric floor(_A1 __lcpp_x) _NOEXCEPT {return ::floor((double)__lcpp_x);} 945*0b57cec5SDimitry Andric 946*0b57cec5SDimitry Andric // fmod 947*0b57cec5SDimitry Andric 948*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 949*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmodf(__lcpp_x, __lcpp_y);} 950*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);} 951*0b57cec5SDimitry Andric #endif 952*0b57cec5SDimitry Andric 953*0b57cec5SDimitry Andric template <class _A1, class _A2> 954*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 955*0b57cec5SDimitry Andric typename std::_EnableIf 956*0b57cec5SDimitry Andric < 957*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 958*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 959*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 960*0b57cec5SDimitry Andric >::type 961*0b57cec5SDimitry Andric fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 962*0b57cec5SDimitry Andric { 963*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 964*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 965*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 966*0b57cec5SDimitry Andric return ::fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y); 967*0b57cec5SDimitry Andric } 968*0b57cec5SDimitry Andric 969*0b57cec5SDimitry Andric // frexp 970*0b57cec5SDimitry Andric 971*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 972*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpf(__lcpp_x, __lcpp_e);} 973*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);} 974*0b57cec5SDimitry Andric #endif 975*0b57cec5SDimitry Andric 976*0b57cec5SDimitry Andric template <class _A1> 977*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 978*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 979*0b57cec5SDimitry Andric frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexp((double)__lcpp_x, __lcpp_e);} 980*0b57cec5SDimitry Andric 981*0b57cec5SDimitry Andric // ldexp 982*0b57cec5SDimitry Andric 983*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 984*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpf(__lcpp_x, __lcpp_e);} 985*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);} 986*0b57cec5SDimitry Andric #endif 987*0b57cec5SDimitry Andric 988*0b57cec5SDimitry Andric template <class _A1> 989*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 990*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 991*0b57cec5SDimitry Andric ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexp((double)__lcpp_x, __lcpp_e);} 992*0b57cec5SDimitry Andric 993*0b57cec5SDimitry Andric // log 994*0b57cec5SDimitry Andric 995*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 996*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return ::logf(__lcpp_x);} 997*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);} 998*0b57cec5SDimitry Andric #endif 999*0b57cec5SDimitry Andric 1000*0b57cec5SDimitry Andric template <class _A1> 1001*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1002*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1003*0b57cec5SDimitry Andric log(_A1 __lcpp_x) _NOEXCEPT {return ::log((double)__lcpp_x);} 1004*0b57cec5SDimitry Andric 1005*0b57cec5SDimitry Andric // log10 1006*0b57cec5SDimitry Andric 1007*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1008*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return ::log10f(__lcpp_x);} 1009*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);} 1010*0b57cec5SDimitry Andric #endif 1011*0b57cec5SDimitry Andric 1012*0b57cec5SDimitry Andric template <class _A1> 1013*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1014*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1015*0b57cec5SDimitry Andric log10(_A1 __lcpp_x) _NOEXCEPT {return ::log10((double)__lcpp_x);} 1016*0b57cec5SDimitry Andric 1017*0b57cec5SDimitry Andric // modf 1018*0b57cec5SDimitry Andric 1019*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1020*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return ::modff(__lcpp_x, __lcpp_y);} 1021*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);} 1022*0b57cec5SDimitry Andric #endif 1023*0b57cec5SDimitry Andric 1024*0b57cec5SDimitry Andric // pow 1025*0b57cec5SDimitry Andric 1026*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1027*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::powf(__lcpp_x, __lcpp_y);} 1028*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);} 1029*0b57cec5SDimitry Andric #endif 1030*0b57cec5SDimitry Andric 1031*0b57cec5SDimitry Andric template <class _A1, class _A2> 1032*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1033*0b57cec5SDimitry Andric typename std::_EnableIf 1034*0b57cec5SDimitry Andric < 1035*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1036*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1037*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1038*0b57cec5SDimitry Andric >::type 1039*0b57cec5SDimitry Andric pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1040*0b57cec5SDimitry Andric { 1041*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1042*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1043*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1044*0b57cec5SDimitry Andric return ::pow((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1045*0b57cec5SDimitry Andric } 1046*0b57cec5SDimitry Andric 1047*0b57cec5SDimitry Andric // sin 1048*0b57cec5SDimitry Andric 1049*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1050*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return ::sinf(__lcpp_x);} 1051*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);} 1052*0b57cec5SDimitry Andric #endif 1053*0b57cec5SDimitry Andric 1054*0b57cec5SDimitry Andric template <class _A1> 1055*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1056*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1057*0b57cec5SDimitry Andric sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);} 1058*0b57cec5SDimitry Andric 1059*0b57cec5SDimitry Andric // sinh 1060*0b57cec5SDimitry Andric 1061*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1062*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return ::sinhf(__lcpp_x);} 1063*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);} 1064*0b57cec5SDimitry Andric #endif 1065*0b57cec5SDimitry Andric 1066*0b57cec5SDimitry Andric template <class _A1> 1067*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1068*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1069*0b57cec5SDimitry Andric sinh(_A1 __lcpp_x) _NOEXCEPT {return ::sinh((double)__lcpp_x);} 1070*0b57cec5SDimitry Andric 1071*0b57cec5SDimitry Andric // sqrt 1072*0b57cec5SDimitry Andric 1073*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1074*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return ::sqrtf(__lcpp_x);} 1075*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);} 1076*0b57cec5SDimitry Andric #endif 1077*0b57cec5SDimitry Andric 1078*0b57cec5SDimitry Andric template <class _A1> 1079*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1080*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1081*0b57cec5SDimitry Andric sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((double)__lcpp_x);} 1082*0b57cec5SDimitry Andric 1083*0b57cec5SDimitry Andric // tan 1084*0b57cec5SDimitry Andric 1085*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1086*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return ::tanf(__lcpp_x);} 1087*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);} 1088*0b57cec5SDimitry Andric #endif 1089*0b57cec5SDimitry Andric 1090*0b57cec5SDimitry Andric template <class _A1> 1091*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1092*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1093*0b57cec5SDimitry Andric tan(_A1 __lcpp_x) _NOEXCEPT {return ::tan((double)__lcpp_x);} 1094*0b57cec5SDimitry Andric 1095*0b57cec5SDimitry Andric // tanh 1096*0b57cec5SDimitry Andric 1097*0b57cec5SDimitry Andric #if !(defined(_AIX) || defined(__sun__)) 1098*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return ::tanhf(__lcpp_x);} 1099*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);} 1100*0b57cec5SDimitry Andric #endif 1101*0b57cec5SDimitry Andric 1102*0b57cec5SDimitry Andric template <class _A1> 1103*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1104*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1105*0b57cec5SDimitry Andric tanh(_A1 __lcpp_x) _NOEXCEPT {return ::tanh((double)__lcpp_x);} 1106*0b57cec5SDimitry Andric 1107*0b57cec5SDimitry Andric // acosh 1108*0b57cec5SDimitry Andric 1109*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return ::acoshf(__lcpp_x);} 1110*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);} 1111*0b57cec5SDimitry Andric 1112*0b57cec5SDimitry Andric template <class _A1> 1113*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1114*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1115*0b57cec5SDimitry Andric acosh(_A1 __lcpp_x) _NOEXCEPT {return ::acosh((double)__lcpp_x);} 1116*0b57cec5SDimitry Andric 1117*0b57cec5SDimitry Andric // asinh 1118*0b57cec5SDimitry Andric 1119*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return ::asinhf(__lcpp_x);} 1120*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);} 1121*0b57cec5SDimitry Andric 1122*0b57cec5SDimitry Andric template <class _A1> 1123*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1124*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1125*0b57cec5SDimitry Andric asinh(_A1 __lcpp_x) _NOEXCEPT {return ::asinh((double)__lcpp_x);} 1126*0b57cec5SDimitry Andric 1127*0b57cec5SDimitry Andric // atanh 1128*0b57cec5SDimitry Andric 1129*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return ::atanhf(__lcpp_x);} 1130*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);} 1131*0b57cec5SDimitry Andric 1132*0b57cec5SDimitry Andric template <class _A1> 1133*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1134*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1135*0b57cec5SDimitry Andric atanh(_A1 __lcpp_x) _NOEXCEPT {return ::atanh((double)__lcpp_x);} 1136*0b57cec5SDimitry Andric 1137*0b57cec5SDimitry Andric // cbrt 1138*0b57cec5SDimitry Andric 1139*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return ::cbrtf(__lcpp_x);} 1140*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);} 1141*0b57cec5SDimitry Andric 1142*0b57cec5SDimitry Andric template <class _A1> 1143*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1144*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1145*0b57cec5SDimitry Andric cbrt(_A1 __lcpp_x) _NOEXCEPT {return ::cbrt((double)__lcpp_x);} 1146*0b57cec5SDimitry Andric 1147*0b57cec5SDimitry Andric // copysign 1148*0b57cec5SDimitry Andric 1149*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x, 1150*0b57cec5SDimitry Andric float __lcpp_y) _NOEXCEPT { 1151*0b57cec5SDimitry Andric return ::copysignf(__lcpp_x, __lcpp_y); 1152*0b57cec5SDimitry Andric } 1153*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double 1154*0b57cec5SDimitry Andric copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT { 1155*0b57cec5SDimitry Andric return ::copysignl(__lcpp_x, __lcpp_y); 1156*0b57cec5SDimitry Andric } 1157*0b57cec5SDimitry Andric 1158*0b57cec5SDimitry Andric template <class _A1, class _A2> 1159*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1160*0b57cec5SDimitry Andric typename std::_EnableIf 1161*0b57cec5SDimitry Andric < 1162*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1163*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1164*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1165*0b57cec5SDimitry Andric >::type 1166*0b57cec5SDimitry Andric copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1167*0b57cec5SDimitry Andric { 1168*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1169*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1170*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1171*0b57cec5SDimitry Andric return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1172*0b57cec5SDimitry Andric } 1173*0b57cec5SDimitry Andric 1174*0b57cec5SDimitry Andric // erf 1175*0b57cec5SDimitry Andric 1176*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return ::erff(__lcpp_x);} 1177*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);} 1178*0b57cec5SDimitry Andric 1179*0b57cec5SDimitry Andric template <class _A1> 1180*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1181*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1182*0b57cec5SDimitry Andric erf(_A1 __lcpp_x) _NOEXCEPT {return ::erf((double)__lcpp_x);} 1183*0b57cec5SDimitry Andric 1184*0b57cec5SDimitry Andric // erfc 1185*0b57cec5SDimitry Andric 1186*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return ::erfcf(__lcpp_x);} 1187*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);} 1188*0b57cec5SDimitry Andric 1189*0b57cec5SDimitry Andric template <class _A1> 1190*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1191*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1192*0b57cec5SDimitry Andric erfc(_A1 __lcpp_x) _NOEXCEPT {return ::erfc((double)__lcpp_x);} 1193*0b57cec5SDimitry Andric 1194*0b57cec5SDimitry Andric // exp2 1195*0b57cec5SDimitry Andric 1196*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return ::exp2f(__lcpp_x);} 1197*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);} 1198*0b57cec5SDimitry Andric 1199*0b57cec5SDimitry Andric template <class _A1> 1200*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1201*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1202*0b57cec5SDimitry Andric exp2(_A1 __lcpp_x) _NOEXCEPT {return ::exp2((double)__lcpp_x);} 1203*0b57cec5SDimitry Andric 1204*0b57cec5SDimitry Andric // expm1 1205*0b57cec5SDimitry Andric 1206*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return ::expm1f(__lcpp_x);} 1207*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);} 1208*0b57cec5SDimitry Andric 1209*0b57cec5SDimitry Andric template <class _A1> 1210*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1211*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1212*0b57cec5SDimitry Andric expm1(_A1 __lcpp_x) _NOEXCEPT {return ::expm1((double)__lcpp_x);} 1213*0b57cec5SDimitry Andric 1214*0b57cec5SDimitry Andric // fdim 1215*0b57cec5SDimitry Andric 1216*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fdimf(__lcpp_x, __lcpp_y);} 1217*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);} 1218*0b57cec5SDimitry Andric 1219*0b57cec5SDimitry Andric template <class _A1, class _A2> 1220*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1221*0b57cec5SDimitry Andric typename std::_EnableIf 1222*0b57cec5SDimitry Andric < 1223*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1224*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1225*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1226*0b57cec5SDimitry Andric >::type 1227*0b57cec5SDimitry Andric fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1228*0b57cec5SDimitry Andric { 1229*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1230*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1231*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1232*0b57cec5SDimitry Andric return ::fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1233*0b57cec5SDimitry Andric } 1234*0b57cec5SDimitry Andric 1235*0b57cec5SDimitry Andric // fma 1236*0b57cec5SDimitry Andric 1237*0b57cec5SDimitry 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);} 1238*0b57cec5SDimitry 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);} 1239*0b57cec5SDimitry Andric 1240*0b57cec5SDimitry Andric template <class _A1, class _A2, class _A3> 1241*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1242*0b57cec5SDimitry Andric typename std::_EnableIf 1243*0b57cec5SDimitry Andric < 1244*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1245*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value && 1246*0b57cec5SDimitry Andric std::is_arithmetic<_A3>::value, 1247*0b57cec5SDimitry Andric std::__promote<_A1, _A2, _A3> 1248*0b57cec5SDimitry Andric >::type 1249*0b57cec5SDimitry Andric fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT 1250*0b57cec5SDimitry Andric { 1251*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2, _A3>::type __result_type; 1252*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1253*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value && 1254*0b57cec5SDimitry Andric std::_IsSame<_A3, __result_type>::value)), ""); 1255*0b57cec5SDimitry Andric return ::fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z); 1256*0b57cec5SDimitry Andric } 1257*0b57cec5SDimitry Andric 1258*0b57cec5SDimitry Andric // fmax 1259*0b57cec5SDimitry Andric 1260*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmaxf(__lcpp_x, __lcpp_y);} 1261*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);} 1262*0b57cec5SDimitry Andric 1263*0b57cec5SDimitry Andric template <class _A1, class _A2> 1264*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1265*0b57cec5SDimitry Andric typename std::_EnableIf 1266*0b57cec5SDimitry Andric < 1267*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1268*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1269*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1270*0b57cec5SDimitry Andric >::type 1271*0b57cec5SDimitry Andric fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1272*0b57cec5SDimitry Andric { 1273*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1274*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1275*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1276*0b57cec5SDimitry Andric return ::fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1277*0b57cec5SDimitry Andric } 1278*0b57cec5SDimitry Andric 1279*0b57cec5SDimitry Andric // fmin 1280*0b57cec5SDimitry Andric 1281*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fminf(__lcpp_x, __lcpp_y);} 1282*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);} 1283*0b57cec5SDimitry Andric 1284*0b57cec5SDimitry Andric template <class _A1, class _A2> 1285*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1286*0b57cec5SDimitry Andric typename std::_EnableIf 1287*0b57cec5SDimitry Andric < 1288*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1289*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1290*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1291*0b57cec5SDimitry Andric >::type 1292*0b57cec5SDimitry Andric fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1293*0b57cec5SDimitry Andric { 1294*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1295*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1296*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1297*0b57cec5SDimitry Andric return ::fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1298*0b57cec5SDimitry Andric } 1299*0b57cec5SDimitry Andric 1300*0b57cec5SDimitry Andric // hypot 1301*0b57cec5SDimitry Andric 1302*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::hypotf(__lcpp_x, __lcpp_y);} 1303*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);} 1304*0b57cec5SDimitry Andric 1305*0b57cec5SDimitry Andric template <class _A1, class _A2> 1306*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1307*0b57cec5SDimitry Andric typename std::_EnableIf 1308*0b57cec5SDimitry Andric < 1309*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1310*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1311*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1312*0b57cec5SDimitry Andric >::type 1313*0b57cec5SDimitry Andric hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1314*0b57cec5SDimitry Andric { 1315*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1316*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1317*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1318*0b57cec5SDimitry Andric return ::hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1319*0b57cec5SDimitry Andric } 1320*0b57cec5SDimitry Andric 1321*0b57cec5SDimitry Andric // ilogb 1322*0b57cec5SDimitry Andric 1323*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ::ilogbf(__lcpp_x);} 1324*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);} 1325*0b57cec5SDimitry Andric 1326*0b57cec5SDimitry Andric template <class _A1> 1327*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1328*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, int>::type 1329*0b57cec5SDimitry Andric ilogb(_A1 __lcpp_x) _NOEXCEPT {return ::ilogb((double)__lcpp_x);} 1330*0b57cec5SDimitry Andric 1331*0b57cec5SDimitry Andric // lgamma 1332*0b57cec5SDimitry Andric 1333*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return ::lgammaf(__lcpp_x);} 1334*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);} 1335*0b57cec5SDimitry Andric 1336*0b57cec5SDimitry Andric template <class _A1> 1337*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1338*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1339*0b57cec5SDimitry Andric lgamma(_A1 __lcpp_x) _NOEXCEPT {return ::lgamma((double)__lcpp_x);} 1340*0b57cec5SDimitry Andric 1341*0b57cec5SDimitry Andric // llrint 1342*0b57cec5SDimitry Andric 1343*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return ::llrintf(__lcpp_x);} 1344*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return ::llrintl(__lcpp_x);} 1345*0b57cec5SDimitry Andric 1346*0b57cec5SDimitry Andric template <class _A1> 1347*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1348*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long long>::type 1349*0b57cec5SDimitry Andric llrint(_A1 __lcpp_x) _NOEXCEPT {return ::llrint((double)__lcpp_x);} 1350*0b57cec5SDimitry Andric 1351*0b57cec5SDimitry Andric // llround 1352*0b57cec5SDimitry Andric 1353*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return ::llroundf(__lcpp_x);} 1354*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return ::llroundl(__lcpp_x);} 1355*0b57cec5SDimitry Andric 1356*0b57cec5SDimitry Andric template <class _A1> 1357*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1358*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long long>::type 1359*0b57cec5SDimitry Andric llround(_A1 __lcpp_x) _NOEXCEPT {return ::llround((double)__lcpp_x);} 1360*0b57cec5SDimitry Andric 1361*0b57cec5SDimitry Andric // log1p 1362*0b57cec5SDimitry Andric 1363*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return ::log1pf(__lcpp_x);} 1364*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);} 1365*0b57cec5SDimitry Andric 1366*0b57cec5SDimitry Andric template <class _A1> 1367*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1368*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1369*0b57cec5SDimitry Andric log1p(_A1 __lcpp_x) _NOEXCEPT {return ::log1p((double)__lcpp_x);} 1370*0b57cec5SDimitry Andric 1371*0b57cec5SDimitry Andric // log2 1372*0b57cec5SDimitry Andric 1373*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return ::log2f(__lcpp_x);} 1374*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);} 1375*0b57cec5SDimitry Andric 1376*0b57cec5SDimitry Andric template <class _A1> 1377*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1378*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1379*0b57cec5SDimitry Andric log2(_A1 __lcpp_x) _NOEXCEPT {return ::log2((double)__lcpp_x);} 1380*0b57cec5SDimitry Andric 1381*0b57cec5SDimitry Andric // logb 1382*0b57cec5SDimitry Andric 1383*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return ::logbf(__lcpp_x);} 1384*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);} 1385*0b57cec5SDimitry Andric 1386*0b57cec5SDimitry Andric template <class _A1> 1387*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1388*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1389*0b57cec5SDimitry Andric logb(_A1 __lcpp_x) _NOEXCEPT {return ::logb((double)__lcpp_x);} 1390*0b57cec5SDimitry Andric 1391*0b57cec5SDimitry Andric // lrint 1392*0b57cec5SDimitry Andric 1393*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return ::lrintf(__lcpp_x);} 1394*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return ::lrintl(__lcpp_x);} 1395*0b57cec5SDimitry Andric 1396*0b57cec5SDimitry Andric template <class _A1> 1397*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1398*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long>::type 1399*0b57cec5SDimitry Andric lrint(_A1 __lcpp_x) _NOEXCEPT {return ::lrint((double)__lcpp_x);} 1400*0b57cec5SDimitry Andric 1401*0b57cec5SDimitry Andric // lround 1402*0b57cec5SDimitry Andric 1403*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return ::lroundf(__lcpp_x);} 1404*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return ::lroundl(__lcpp_x);} 1405*0b57cec5SDimitry Andric 1406*0b57cec5SDimitry Andric template <class _A1> 1407*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1408*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, long>::type 1409*0b57cec5SDimitry Andric lround(_A1 __lcpp_x) _NOEXCEPT {return ::lround((double)__lcpp_x);} 1410*0b57cec5SDimitry Andric 1411*0b57cec5SDimitry Andric // nan 1412*0b57cec5SDimitry Andric 1413*0b57cec5SDimitry Andric // nearbyint 1414*0b57cec5SDimitry Andric 1415*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return ::nearbyintf(__lcpp_x);} 1416*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);} 1417*0b57cec5SDimitry Andric 1418*0b57cec5SDimitry Andric template <class _A1> 1419*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1420*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1421*0b57cec5SDimitry Andric nearbyint(_A1 __lcpp_x) _NOEXCEPT {return ::nearbyint((double)__lcpp_x);} 1422*0b57cec5SDimitry Andric 1423*0b57cec5SDimitry Andric // nextafter 1424*0b57cec5SDimitry Andric 1425*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::nextafterf(__lcpp_x, __lcpp_y);} 1426*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);} 1427*0b57cec5SDimitry Andric 1428*0b57cec5SDimitry Andric template <class _A1, class _A2> 1429*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1430*0b57cec5SDimitry Andric typename std::_EnableIf 1431*0b57cec5SDimitry Andric < 1432*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1433*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1434*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1435*0b57cec5SDimitry Andric >::type 1436*0b57cec5SDimitry Andric nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1437*0b57cec5SDimitry Andric { 1438*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1439*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1440*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1441*0b57cec5SDimitry Andric return ::nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1442*0b57cec5SDimitry Andric } 1443*0b57cec5SDimitry Andric 1444*0b57cec5SDimitry Andric // nexttoward 1445*0b57cec5SDimitry Andric 1446*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardf(__lcpp_x, __lcpp_y);} 1447*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);} 1448*0b57cec5SDimitry Andric 1449*0b57cec5SDimitry Andric template <class _A1> 1450*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1451*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1452*0b57cec5SDimitry Andric nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttoward((double)__lcpp_x, __lcpp_y);} 1453*0b57cec5SDimitry Andric 1454*0b57cec5SDimitry Andric // remainder 1455*0b57cec5SDimitry Andric 1456*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::remainderf(__lcpp_x, __lcpp_y);} 1457*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);} 1458*0b57cec5SDimitry Andric 1459*0b57cec5SDimitry Andric template <class _A1, class _A2> 1460*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1461*0b57cec5SDimitry Andric typename std::_EnableIf 1462*0b57cec5SDimitry Andric < 1463*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1464*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1465*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1466*0b57cec5SDimitry Andric >::type 1467*0b57cec5SDimitry Andric remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1468*0b57cec5SDimitry Andric { 1469*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1470*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1471*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1472*0b57cec5SDimitry Andric return ::remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1473*0b57cec5SDimitry Andric } 1474*0b57cec5SDimitry Andric 1475*0b57cec5SDimitry Andric // remquo 1476*0b57cec5SDimitry Andric 1477*0b57cec5SDimitry 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);} 1478*0b57cec5SDimitry 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);} 1479*0b57cec5SDimitry Andric 1480*0b57cec5SDimitry Andric template <class _A1, class _A2> 1481*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1482*0b57cec5SDimitry Andric typename std::_EnableIf 1483*0b57cec5SDimitry Andric < 1484*0b57cec5SDimitry Andric std::is_arithmetic<_A1>::value && 1485*0b57cec5SDimitry Andric std::is_arithmetic<_A2>::value, 1486*0b57cec5SDimitry Andric std::__promote<_A1, _A2> 1487*0b57cec5SDimitry Andric >::type 1488*0b57cec5SDimitry Andric remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT 1489*0b57cec5SDimitry Andric { 1490*0b57cec5SDimitry Andric typedef typename std::__promote<_A1, _A2>::type __result_type; 1491*0b57cec5SDimitry Andric static_assert((!(std::_IsSame<_A1, __result_type>::value && 1492*0b57cec5SDimitry Andric std::_IsSame<_A2, __result_type>::value)), ""); 1493*0b57cec5SDimitry Andric return ::remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z); 1494*0b57cec5SDimitry Andric } 1495*0b57cec5SDimitry Andric 1496*0b57cec5SDimitry Andric // rint 1497*0b57cec5SDimitry Andric 1498*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return ::rintf(__lcpp_x);} 1499*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return ::rintl(__lcpp_x);} 1500*0b57cec5SDimitry Andric 1501*0b57cec5SDimitry Andric template <class _A1> 1502*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1503*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1504*0b57cec5SDimitry Andric rint(_A1 __lcpp_x) _NOEXCEPT {return ::rint((double)__lcpp_x);} 1505*0b57cec5SDimitry Andric 1506*0b57cec5SDimitry Andric // round 1507*0b57cec5SDimitry Andric 1508*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return ::roundf(__lcpp_x);} 1509*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return ::roundl(__lcpp_x);} 1510*0b57cec5SDimitry Andric 1511*0b57cec5SDimitry Andric template <class _A1> 1512*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1513*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1514*0b57cec5SDimitry Andric round(_A1 __lcpp_x) _NOEXCEPT {return ::round((double)__lcpp_x);} 1515*0b57cec5SDimitry Andric 1516*0b57cec5SDimitry Andric // scalbln 1517*0b57cec5SDimitry Andric 1518*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnf(__lcpp_x, __lcpp_y);} 1519*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);} 1520*0b57cec5SDimitry Andric 1521*0b57cec5SDimitry Andric template <class _A1> 1522*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1523*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1524*0b57cec5SDimitry Andric scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalbln((double)__lcpp_x, __lcpp_y);} 1525*0b57cec5SDimitry Andric 1526*0b57cec5SDimitry Andric // scalbn 1527*0b57cec5SDimitry Andric 1528*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnf(__lcpp_x, __lcpp_y);} 1529*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);} 1530*0b57cec5SDimitry Andric 1531*0b57cec5SDimitry Andric template <class _A1> 1532*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1533*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1534*0b57cec5SDimitry Andric scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbn((double)__lcpp_x, __lcpp_y);} 1535*0b57cec5SDimitry Andric 1536*0b57cec5SDimitry Andric // tgamma 1537*0b57cec5SDimitry Andric 1538*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return ::tgammaf(__lcpp_x);} 1539*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);} 1540*0b57cec5SDimitry Andric 1541*0b57cec5SDimitry Andric template <class _A1> 1542*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1543*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1544*0b57cec5SDimitry Andric tgamma(_A1 __lcpp_x) _NOEXCEPT {return ::tgamma((double)__lcpp_x);} 1545*0b57cec5SDimitry Andric 1546*0b57cec5SDimitry Andric // trunc 1547*0b57cec5SDimitry Andric 1548*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return ::truncf(__lcpp_x);} 1549*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return ::truncl(__lcpp_x);} 1550*0b57cec5SDimitry Andric 1551*0b57cec5SDimitry Andric template <class _A1> 1552*0b57cec5SDimitry Andric inline _LIBCPP_INLINE_VISIBILITY 1553*0b57cec5SDimitry Andric typename std::enable_if<std::is_integral<_A1>::value, double>::type 1554*0b57cec5SDimitry Andric trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);} 1555*0b57cec5SDimitry Andric 1556*0b57cec5SDimitry Andric } // extern "C++" 1557*0b57cec5SDimitry Andric 1558*0b57cec5SDimitry Andric #endif // __cplusplus 1559*0b57cec5SDimitry Andric 1560*0b57cec5SDimitry Andric #else // _LIBCPP_MATH_H 1561*0b57cec5SDimitry Andric 1562*0b57cec5SDimitry Andric // This include lives outside the header guard in order to support an MSVC 1563*0b57cec5SDimitry Andric // extension which allows users to do: 1564*0b57cec5SDimitry Andric // 1565*0b57cec5SDimitry Andric // #define _USE_MATH_DEFINES 1566*0b57cec5SDimitry Andric // #include <math.h> 1567*0b57cec5SDimitry Andric // 1568*0b57cec5SDimitry Andric // and receive the definitions of mathematical constants, even if <math.h> 1569*0b57cec5SDimitry Andric // has previously been included. 1570*0b57cec5SDimitry Andric #if defined(_LIBCPP_MSVCRT) && defined(_USE_MATH_DEFINES) 1571*0b57cec5SDimitry Andric #include_next <math.h> 1572*0b57cec5SDimitry Andric #endif 1573*0b57cec5SDimitry Andric 1574*0b57cec5SDimitry Andric #endif // _LIBCPP_MATH_H 1575