cmath revision 288943
1227825Stheraven// -*- C++ -*- 2227825Stheraven//===---------------------------- cmath -----------------------------------===// 3227825Stheraven// 4227825Stheraven// The LLVM Compiler Infrastructure 5227825Stheraven// 6227825Stheraven// This file is dual licensed under the MIT and the University of Illinois Open 7227825Stheraven// Source Licenses. See LICENSE.TXT for details. 8227825Stheraven// 9227825Stheraven//===----------------------------------------------------------------------===// 10227825Stheraven 11227825Stheraven#ifndef _LIBCPP_CMATH 12227825Stheraven#define _LIBCPP_CMATH 13227825Stheraven 14227825Stheraven/* 15227825Stheraven cmath synopsis 16227825Stheraven 17227825StheravenMacros: 18227825Stheraven 19227825Stheraven HUGE_VAL 20227825Stheraven HUGE_VALF // C99 21227825Stheraven HUGE_VALL // C99 22227825Stheraven INFINITY // C99 23227825Stheraven NAN // C99 24227825Stheraven FP_INFINITE // C99 25227825Stheraven FP_NAN // C99 26227825Stheraven FP_NORMAL // C99 27227825Stheraven FP_SUBNORMAL // C99 28227825Stheraven FP_ZERO // C99 29227825Stheraven FP_FAST_FMA // C99 30227825Stheraven FP_FAST_FMAF // C99 31227825Stheraven FP_FAST_FMAL // C99 32227825Stheraven FP_ILOGB0 // C99 33227825Stheraven FP_ILOGBNAN // C99 34227825Stheraven MATH_ERRNO // C99 35227825Stheraven MATH_ERREXCEPT // C99 36227825Stheraven math_errhandling // C99 37227825Stheraven 38227825Stheravennamespace std 39227825Stheraven{ 40227825Stheraven 41227825StheravenTypes: 42227825Stheraven 43227825Stheraven float_t // C99 44227825Stheraven double_t // C99 45227825Stheraven 46227825Stheraven// C90 47227825Stheraven 48227825Stheravenfloating_point abs(floating_point x); 49227825Stheraven 50227825Stheravenfloating_point acos (arithmetic x); 51227825Stheravenfloat acosf(float x); 52227825Stheravenlong double acosl(long double x); 53227825Stheraven 54227825Stheravenfloating_point asin (arithmetic x); 55227825Stheravenfloat asinf(float x); 56227825Stheravenlong double asinl(long double x); 57227825Stheraven 58227825Stheravenfloating_point atan (arithmetic x); 59227825Stheravenfloat atanf(float x); 60227825Stheravenlong double atanl(long double x); 61227825Stheraven 62227825Stheravenfloating_point atan2 (arithmetic y, arithmetic x); 63227825Stheravenfloat atan2f(float y, float x); 64227825Stheravenlong double atan2l(long double y, long double x); 65227825Stheraven 66227825Stheravenfloating_point ceil (arithmetic x); 67227825Stheravenfloat ceilf(float x); 68227825Stheravenlong double ceill(long double x); 69227825Stheraven 70227825Stheravenfloating_point cos (arithmetic x); 71227825Stheravenfloat cosf(float x); 72227825Stheravenlong double cosl(long double x); 73227825Stheraven 74227825Stheravenfloating_point cosh (arithmetic x); 75227825Stheravenfloat coshf(float x); 76227825Stheravenlong double coshl(long double x); 77227825Stheraven 78227825Stheravenfloating_point exp (arithmetic x); 79227825Stheravenfloat expf(float x); 80227825Stheravenlong double expl(long double x); 81227825Stheraven 82227825Stheravenfloating_point fabs (arithmetic x); 83227825Stheravenfloat fabsf(float x); 84227825Stheravenlong double fabsl(long double x); 85227825Stheraven 86227825Stheravenfloating_point floor (arithmetic x); 87227825Stheravenfloat floorf(float x); 88227825Stheravenlong double floorl(long double x); 89227825Stheraven 90227825Stheravenfloating_point fmod (arithmetic x, arithmetic y); 91227825Stheravenfloat fmodf(float x, float y); 92227825Stheravenlong double fmodl(long double x, long double y); 93227825Stheraven 94227825Stheravenfloating_point frexp (arithmetic value, int* exp); 95227825Stheravenfloat frexpf(float value, int* exp); 96227825Stheravenlong double frexpl(long double value, int* exp); 97227825Stheraven 98227825Stheravenfloating_point ldexp (arithmetic value, int exp); 99227825Stheravenfloat ldexpf(float value, int exp); 100227825Stheravenlong double ldexpl(long double value, int exp); 101227825Stheraven 102227825Stheravenfloating_point log (arithmetic x); 103227825Stheravenfloat logf(float x); 104227825Stheravenlong double logl(long double x); 105227825Stheraven 106227825Stheravenfloating_point log10 (arithmetic x); 107227825Stheravenfloat log10f(float x); 108227825Stheravenlong double log10l(long double x); 109227825Stheraven 110227825Stheravenfloating_point modf (floating_point value, floating_point* iptr); 111227825Stheravenfloat modff(float value, float* iptr); 112227825Stheravenlong double modfl(long double value, long double* iptr); 113227825Stheraven 114227825Stheravenfloating_point pow (arithmetic x, arithmetic y); 115227825Stheravenfloat powf(float x, float y); 116227825Stheravenlong double powl(long double x, long double y); 117227825Stheraven 118227825Stheravenfloating_point sin (arithmetic x); 119227825Stheravenfloat sinf(float x); 120227825Stheravenlong double sinl(long double x); 121227825Stheraven 122227825Stheravenfloating_point sinh (arithmetic x); 123227825Stheravenfloat sinhf(float x); 124227825Stheravenlong double sinhl(long double x); 125227825Stheraven 126227825Stheravenfloating_point sqrt (arithmetic x); 127227825Stheravenfloat sqrtf(float x); 128227825Stheravenlong double sqrtl(long double x); 129227825Stheraven 130227825Stheravenfloating_point tan (arithmetic x); 131227825Stheravenfloat tanf(float x); 132227825Stheravenlong double tanl(long double x); 133227825Stheraven 134227825Stheravenfloating_point tanh (arithmetic x); 135227825Stheravenfloat tanhf(float x); 136227825Stheravenlong double tanhl(long double x); 137227825Stheraven 138227825Stheraven// C99 139227825Stheraven 140246468Stheravenbool signbit(arithmetic x); 141227825Stheraven 142246468Stheravenint fpclassify(arithmetic x); 143227825Stheraven 144246468Stheravenbool isfinite(arithmetic x); 145246468Stheravenbool isinf(arithmetic x); 146246468Stheravenbool isnan(arithmetic x); 147246468Stheravenbool isnormal(arithmetic x); 148227825Stheraven 149246468Stheravenbool isgreater(arithmetic x, arithmetic y); 150246468Stheravenbool isgreaterequal(arithmetic x, arithmetic y); 151246468Stheravenbool isless(arithmetic x, arithmetic y); 152246468Stheravenbool islessequal(arithmetic x, arithmetic y); 153246468Stheravenbool islessgreater(arithmetic x, arithmetic y); 154246468Stheravenbool isunordered(arithmetic x, arithmetic y); 155227825Stheraven 156227825Stheravenfloating_point acosh (arithmetic x); 157227825Stheravenfloat acoshf(float x); 158227825Stheravenlong double acoshl(long double x); 159227825Stheraven 160227825Stheravenfloating_point asinh (arithmetic x); 161227825Stheravenfloat asinhf(float x); 162227825Stheravenlong double asinhl(long double x); 163227825Stheraven 164227825Stheravenfloating_point atanh (arithmetic x); 165227825Stheravenfloat atanhf(float x); 166227825Stheravenlong double atanhl(long double x); 167227825Stheraven 168227825Stheravenfloating_point cbrt (arithmetic x); 169227825Stheravenfloat cbrtf(float x); 170227825Stheravenlong double cbrtl(long double x); 171227825Stheraven 172227825Stheravenfloating_point copysign (arithmetic x, arithmetic y); 173227825Stheravenfloat copysignf(float x, float y); 174227825Stheravenlong double copysignl(long double x, long double y); 175227825Stheraven 176227825Stheravenfloating_point erf (arithmetic x); 177227825Stheravenfloat erff(float x); 178227825Stheravenlong double erfl(long double x); 179227825Stheraven 180227825Stheravenfloating_point erfc (arithmetic x); 181227825Stheravenfloat erfcf(float x); 182227825Stheravenlong double erfcl(long double x); 183227825Stheraven 184227825Stheravenfloating_point exp2 (arithmetic x); 185227825Stheravenfloat exp2f(float x); 186227825Stheravenlong double exp2l(long double x); 187227825Stheraven 188227825Stheravenfloating_point expm1 (arithmetic x); 189227825Stheravenfloat expm1f(float x); 190227825Stheravenlong double expm1l(long double x); 191227825Stheraven 192227825Stheravenfloating_point fdim (arithmetic x, arithmetic y); 193227825Stheravenfloat fdimf(float x, float y); 194227825Stheravenlong double fdiml(long double x, long double y); 195227825Stheraven 196227825Stheravenfloating_point fma (arithmetic x, arithmetic y, arithmetic z); 197227825Stheravenfloat fmaf(float x, float y, float z); 198227825Stheravenlong double fmal(long double x, long double y, long double z); 199227825Stheraven 200227825Stheravenfloating_point fmax (arithmetic x, arithmetic y); 201227825Stheravenfloat fmaxf(float x, float y); 202227825Stheravenlong double fmaxl(long double x, long double y); 203227825Stheraven 204227825Stheravenfloating_point fmin (arithmetic x, arithmetic y); 205227825Stheravenfloat fminf(float x, float y); 206227825Stheravenlong double fminl(long double x, long double y); 207227825Stheraven 208227825Stheravenfloating_point hypot (arithmetic x, arithmetic y); 209227825Stheravenfloat hypotf(float x, float y); 210227825Stheravenlong double hypotl(long double x, long double y); 211227825Stheraven 212227825Stheravenint ilogb (arithmetic x); 213227825Stheravenint ilogbf(float x); 214227825Stheravenint ilogbl(long double x); 215227825Stheraven 216227825Stheravenfloating_point lgamma (arithmetic x); 217227825Stheravenfloat lgammaf(float x); 218227825Stheravenlong double lgammal(long double x); 219227825Stheraven 220227825Stheravenlong long llrint (arithmetic x); 221227825Stheravenlong long llrintf(float x); 222227825Stheravenlong long llrintl(long double x); 223227825Stheraven 224227825Stheravenlong long llround (arithmetic x); 225227825Stheravenlong long llroundf(float x); 226227825Stheravenlong long llroundl(long double x); 227227825Stheraven 228227825Stheravenfloating_point log1p (arithmetic x); 229227825Stheravenfloat log1pf(float x); 230227825Stheravenlong double log1pl(long double x); 231227825Stheraven 232227825Stheravenfloating_point log2 (arithmetic x); 233227825Stheravenfloat log2f(float x); 234227825Stheravenlong double log2l(long double x); 235227825Stheraven 236227825Stheravenfloating_point logb (arithmetic x); 237227825Stheravenfloat logbf(float x); 238227825Stheravenlong double logbl(long double x); 239227825Stheraven 240227825Stheravenlong lrint (arithmetic x); 241227825Stheravenlong lrintf(float x); 242227825Stheravenlong lrintl(long double x); 243227825Stheraven 244227825Stheravenlong lround (arithmetic x); 245227825Stheravenlong lroundf(float x); 246227825Stheravenlong lroundl(long double x); 247227825Stheraven 248227825Stheravendouble nan (const char* str); 249227825Stheravenfloat nanf(const char* str); 250227825Stheravenlong double nanl(const char* str); 251227825Stheraven 252227825Stheravenfloating_point nearbyint (arithmetic x); 253227825Stheravenfloat nearbyintf(float x); 254227825Stheravenlong double nearbyintl(long double x); 255227825Stheraven 256227825Stheravenfloating_point nextafter (arithmetic x, arithmetic y); 257227825Stheravenfloat nextafterf(float x, float y); 258227825Stheravenlong double nextafterl(long double x, long double y); 259227825Stheraven 260227825Stheravenfloating_point nexttoward (arithmetic x, long double y); 261227825Stheravenfloat nexttowardf(float x, long double y); 262227825Stheravenlong double nexttowardl(long double x, long double y); 263227825Stheraven 264227825Stheravenfloating_point remainder (arithmetic x, arithmetic y); 265227825Stheravenfloat remainderf(float x, float y); 266227825Stheravenlong double remainderl(long double x, long double y); 267227825Stheraven 268227825Stheravenfloating_point remquo (arithmetic x, arithmetic y, int* pquo); 269227825Stheravenfloat remquof(float x, float y, int* pquo); 270227825Stheravenlong double remquol(long double x, long double y, int* pquo); 271227825Stheraven 272227825Stheravenfloating_point rint (arithmetic x); 273227825Stheravenfloat rintf(float x); 274227825Stheravenlong double rintl(long double x); 275227825Stheraven 276227825Stheravenfloating_point round (arithmetic x); 277227825Stheravenfloat roundf(float x); 278227825Stheravenlong double roundl(long double x); 279227825Stheraven 280227825Stheravenfloating_point scalbln (arithmetic x, long ex); 281227825Stheravenfloat scalblnf(float x, long ex); 282227825Stheravenlong double scalblnl(long double x, long ex); 283227825Stheraven 284227825Stheravenfloating_point scalbn (arithmetic x, int ex); 285227825Stheravenfloat scalbnf(float x, int ex); 286227825Stheravenlong double scalbnl(long double x, int ex); 287227825Stheraven 288227825Stheravenfloating_point tgamma (arithmetic x); 289227825Stheravenfloat tgammaf(float x); 290227825Stheravenlong double tgammal(long double x); 291227825Stheraven 292227825Stheravenfloating_point trunc (arithmetic x); 293227825Stheravenfloat truncf(float x); 294227825Stheravenlong double truncl(long double x); 295227825Stheraven 296227825Stheraven} // std 297227825Stheraven 298227825Stheraven*/ 299227825Stheraven 300227825Stheraven#include <__config> 301227825Stheraven#include <math.h> 302227825Stheraven#include <type_traits> 303227825Stheraven 304261272Sdim#ifdef _LIBCPP_MSVCRT 305227825Stheraven#include "support/win32/math_win32.h" 306227825Stheraven#endif 307227825Stheraven 308227825Stheraven#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 309227825Stheraven#pragma GCC system_header 310227825Stheraven#endif 311227825Stheraven 312227825Stheraven// signbit 313227825Stheraven 314227825Stheraven#ifdef signbit 315227825Stheraven 316227825Stheraventemplate <class _A1> 317227825Stheraven_LIBCPP_ALWAYS_INLINE 318227825Stheravenbool 319276792Sdim__libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT 320227825Stheraven{ 321276792Sdim return signbit(__lcpp_x); 322227825Stheraven} 323227825Stheraven 324227825Stheraven#undef signbit 325227825Stheraven 326227825Stheraventemplate <class _A1> 327227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 328246468Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type 329276792Sdimsignbit(_A1 __lcpp_x) _NOEXCEPT 330227825Stheraven{ 331276792Sdim return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x); 332227825Stheraven} 333227825Stheraven 334227825Stheraven#endif // signbit 335227825Stheraven 336227825Stheraven// fpclassify 337227825Stheraven 338227825Stheraven#ifdef fpclassify 339227825Stheraven 340227825Stheraventemplate <class _A1> 341227825Stheraven_LIBCPP_ALWAYS_INLINE 342227825Stheravenint 343276792Sdim__libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT 344227825Stheraven{ 345276792Sdim return fpclassify(__lcpp_x); 346227825Stheraven} 347227825Stheraven 348227825Stheraven#undef fpclassify 349227825Stheraven 350227825Stheraventemplate <class _A1> 351227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 352246468Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, int>::type 353276792Sdimfpclassify(_A1 __lcpp_x) _NOEXCEPT 354227825Stheraven{ 355276792Sdim return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x); 356227825Stheraven} 357227825Stheraven 358227825Stheraven#endif // fpclassify 359227825Stheraven 360227825Stheraven// isfinite 361227825Stheraven 362227825Stheraven#ifdef isfinite 363227825Stheraven 364227825Stheraventemplate <class _A1> 365227825Stheraven_LIBCPP_ALWAYS_INLINE 366227825Stheravenbool 367276792Sdim__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT 368227825Stheraven{ 369276792Sdim return isfinite(__lcpp_x); 370227825Stheraven} 371227825Stheraven 372227825Stheraven#undef isfinite 373227825Stheraven 374227825Stheraventemplate <class _A1> 375227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 376246468Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type 377276792Sdimisfinite(_A1 __lcpp_x) _NOEXCEPT 378227825Stheraven{ 379276792Sdim return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x); 380227825Stheraven} 381227825Stheraven 382227825Stheraven#endif // isfinite 383227825Stheraven 384227825Stheraven// isinf 385227825Stheraven 386227825Stheraven#ifdef isinf 387227825Stheraven 388227825Stheraventemplate <class _A1> 389227825Stheraven_LIBCPP_ALWAYS_INLINE 390227825Stheravenbool 391276792Sdim__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT 392227825Stheraven{ 393276792Sdim return isinf(__lcpp_x); 394227825Stheraven} 395227825Stheraven 396227825Stheraven#undef isinf 397227825Stheraven 398227825Stheraventemplate <class _A1> 399227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 400246468Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type 401276792Sdimisinf(_A1 __lcpp_x) _NOEXCEPT 402227825Stheraven{ 403276792Sdim return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x); 404227825Stheraven} 405227825Stheraven 406227825Stheraven#endif // isinf 407227825Stheraven 408227825Stheraven// isnan 409227825Stheraven 410227825Stheraven#ifdef isnan 411227825Stheraven 412227825Stheraventemplate <class _A1> 413227825Stheraven_LIBCPP_ALWAYS_INLINE 414227825Stheravenbool 415276792Sdim__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT 416227825Stheraven{ 417276792Sdim return isnan(__lcpp_x); 418227825Stheraven} 419227825Stheraven 420227825Stheraven#undef isnan 421227825Stheraven 422227825Stheraventemplate <class _A1> 423227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 424246468Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type 425276792Sdimisnan(_A1 __lcpp_x) _NOEXCEPT 426227825Stheraven{ 427276792Sdim return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x); 428227825Stheraven} 429227825Stheraven 430227825Stheraven#endif // isnan 431227825Stheraven 432227825Stheraven// isnormal 433227825Stheraven 434227825Stheraven#ifdef isnormal 435227825Stheraven 436227825Stheraventemplate <class _A1> 437227825Stheraven_LIBCPP_ALWAYS_INLINE 438227825Stheravenbool 439276792Sdim__libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT 440227825Stheraven{ 441276792Sdim return isnormal(__lcpp_x); 442227825Stheraven} 443227825Stheraven 444227825Stheraven#undef isnormal 445227825Stheraven 446227825Stheraventemplate <class _A1> 447227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 448246468Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type 449276792Sdimisnormal(_A1 __lcpp_x) _NOEXCEPT 450227825Stheraven{ 451276792Sdim return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x); 452227825Stheraven} 453227825Stheraven 454227825Stheraven#endif // isnormal 455227825Stheraven 456227825Stheraven// isgreater 457227825Stheraven 458227825Stheraven#ifdef isgreater 459227825Stheraven 460227825Stheraventemplate <class _A1, class _A2> 461227825Stheraven_LIBCPP_ALWAYS_INLINE 462227825Stheravenbool 463276792Sdim__libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 464227825Stheraven{ 465276792Sdim return isgreater(__lcpp_x, __lcpp_y); 466227825Stheraven} 467227825Stheraven 468227825Stheraven#undef isgreater 469227825Stheraven 470227825Stheraventemplate <class _A1, class _A2> 471227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 472227825Stheraventypename std::enable_if 473227825Stheraven< 474246468Stheraven std::is_arithmetic<_A1>::value && 475246468Stheraven std::is_arithmetic<_A2>::value, 476227825Stheraven bool 477227825Stheraven>::type 478276792Sdimisgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 479227825Stheraven{ 480246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 481276792Sdim return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y); 482227825Stheraven} 483227825Stheraven 484227825Stheraven#endif // isgreater 485227825Stheraven 486227825Stheraven// isgreaterequal 487227825Stheraven 488227825Stheraven#ifdef isgreaterequal 489227825Stheraven 490227825Stheraventemplate <class _A1, class _A2> 491227825Stheraven_LIBCPP_ALWAYS_INLINE 492227825Stheravenbool 493276792Sdim__libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 494227825Stheraven{ 495276792Sdim return isgreaterequal(__lcpp_x, __lcpp_y); 496227825Stheraven} 497227825Stheraven 498227825Stheraven#undef isgreaterequal 499227825Stheraven 500227825Stheraventemplate <class _A1, class _A2> 501227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 502227825Stheraventypename std::enable_if 503227825Stheraven< 504246468Stheraven std::is_arithmetic<_A1>::value && 505246468Stheraven std::is_arithmetic<_A2>::value, 506227825Stheraven bool 507227825Stheraven>::type 508276792Sdimisgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 509227825Stheraven{ 510246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 511276792Sdim return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y); 512227825Stheraven} 513227825Stheraven 514227825Stheraven#endif // isgreaterequal 515227825Stheraven 516227825Stheraven// isless 517227825Stheraven 518227825Stheraven#ifdef isless 519227825Stheraven 520227825Stheraventemplate <class _A1, class _A2> 521227825Stheraven_LIBCPP_ALWAYS_INLINE 522227825Stheravenbool 523276792Sdim__libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 524227825Stheraven{ 525276792Sdim return isless(__lcpp_x, __lcpp_y); 526227825Stheraven} 527227825Stheraven 528227825Stheraven#undef isless 529227825Stheraven 530227825Stheraventemplate <class _A1, class _A2> 531227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 532227825Stheraventypename std::enable_if 533227825Stheraven< 534246468Stheraven std::is_arithmetic<_A1>::value && 535246468Stheraven std::is_arithmetic<_A2>::value, 536227825Stheraven bool 537227825Stheraven>::type 538276792Sdimisless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 539227825Stheraven{ 540246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 541276792Sdim return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y); 542227825Stheraven} 543227825Stheraven 544227825Stheraven#endif // isless 545227825Stheraven 546227825Stheraven// islessequal 547227825Stheraven 548227825Stheraven#ifdef islessequal 549227825Stheraven 550227825Stheraventemplate <class _A1, class _A2> 551227825Stheraven_LIBCPP_ALWAYS_INLINE 552227825Stheravenbool 553276792Sdim__libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 554227825Stheraven{ 555276792Sdim return islessequal(__lcpp_x, __lcpp_y); 556227825Stheraven} 557227825Stheraven 558227825Stheraven#undef islessequal 559227825Stheraven 560227825Stheraventemplate <class _A1, class _A2> 561227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 562227825Stheraventypename std::enable_if 563227825Stheraven< 564246468Stheraven std::is_arithmetic<_A1>::value && 565246468Stheraven std::is_arithmetic<_A2>::value, 566227825Stheraven bool 567227825Stheraven>::type 568276792Sdimislessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 569227825Stheraven{ 570246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 571276792Sdim return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y); 572227825Stheraven} 573227825Stheraven 574227825Stheraven#endif // islessequal 575227825Stheraven 576227825Stheraven// islessgreater 577227825Stheraven 578227825Stheraven#ifdef islessgreater 579227825Stheraven 580227825Stheraventemplate <class _A1, class _A2> 581227825Stheraven_LIBCPP_ALWAYS_INLINE 582227825Stheravenbool 583276792Sdim__libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 584227825Stheraven{ 585276792Sdim return islessgreater(__lcpp_x, __lcpp_y); 586227825Stheraven} 587227825Stheraven 588227825Stheraven#undef islessgreater 589227825Stheraven 590227825Stheraventemplate <class _A1, class _A2> 591227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 592227825Stheraventypename std::enable_if 593227825Stheraven< 594246468Stheraven std::is_arithmetic<_A1>::value && 595246468Stheraven std::is_arithmetic<_A2>::value, 596227825Stheraven bool 597227825Stheraven>::type 598276792Sdimislessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 599227825Stheraven{ 600246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 601276792Sdim return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y); 602227825Stheraven} 603227825Stheraven 604227825Stheraven#endif // islessgreater 605227825Stheraven 606227825Stheraven// isunordered 607227825Stheraven 608227825Stheraven#ifdef isunordered 609227825Stheraven 610227825Stheraventemplate <class _A1, class _A2> 611227825Stheraven_LIBCPP_ALWAYS_INLINE 612227825Stheravenbool 613276792Sdim__libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 614227825Stheraven{ 615276792Sdim return isunordered(__lcpp_x, __lcpp_y); 616227825Stheraven} 617227825Stheraven 618227825Stheraven#undef isunordered 619227825Stheraven 620227825Stheraventemplate <class _A1, class _A2> 621227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 622227825Stheraventypename std::enable_if 623227825Stheraven< 624246468Stheraven std::is_arithmetic<_A1>::value && 625246468Stheraven std::is_arithmetic<_A2>::value, 626227825Stheraven bool 627227825Stheraven>::type 628276792Sdimisunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 629227825Stheraven{ 630246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 631276792Sdim return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y); 632227825Stheraven} 633227825Stheraven 634227825Stheraven#endif // isunordered 635227825Stheraven 636227825Stheraven_LIBCPP_BEGIN_NAMESPACE_STD 637227825Stheraven 638227825Stheravenusing ::signbit; 639227825Stheravenusing ::fpclassify; 640227825Stheravenusing ::isfinite; 641227825Stheravenusing ::isinf; 642227825Stheravenusing ::isnan; 643227825Stheravenusing ::isnormal; 644227825Stheravenusing ::isgreater; 645227825Stheravenusing ::isgreaterequal; 646227825Stheravenusing ::isless; 647227825Stheravenusing ::islessequal; 648227825Stheravenusing ::islessgreater; 649227825Stheravenusing ::isunordered; 650227825Stheravenusing ::isunordered; 651227825Stheraven 652227825Stheravenusing ::float_t; 653227825Stheravenusing ::double_t; 654227825Stheraven 655227825Stheraven// abs 656227825Stheraven 657288943Sdim#if defined(__sun__) 658288943Sdimusing ::abs; 659288943Sdim#endif 660288943Sdim 661288943Sdim#if !defined(_AIX) && !defined(__sun__) 662227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 663234959Stheravenfloat 664276792Sdimabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);} 665227825Stheraven 666234959Stheraveninline _LIBCPP_INLINE_VISIBILITY 667234959Stheravendouble 668276792Sdimabs(double __lcpp_x) _NOEXCEPT {return fabs(__lcpp_x);} 669234959Stheraven 670234959Stheraveninline _LIBCPP_INLINE_VISIBILITY 671234959Stheravenlong double 672276792Sdimabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);} 673261272Sdim#endif // !defined(_AIX) 674234959Stheraven 675232924Stheraven#ifndef __sun__ 676232924Stheraven 677227825Stheraven// acos 678227825Stheraven 679227825Stheravenusing ::acos; 680227825Stheravenusing ::acosf; 681227825Stheraven 682261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 683276792Sdiminline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return acosf(__lcpp_x);} 684276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);} 685227825Stheraven#endif 686227825Stheraven 687227825Stheraventemplate <class _A1> 688227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 689227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 690276792Sdimacos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);} 691227825Stheraven 692227825Stheraven// asin 693227825Stheraven 694227825Stheravenusing ::asin; 695227825Stheravenusing ::asinf; 696227825Stheraven 697261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 698276792Sdiminline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return asinf(__lcpp_x);} 699276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);} 700227825Stheraven#endif 701227825Stheraven 702227825Stheraventemplate <class _A1> 703227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 704227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 705276792Sdimasin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);} 706227825Stheraven 707227825Stheraven// atan 708227825Stheraven 709227825Stheravenusing ::atan; 710227825Stheravenusing ::atanf; 711227825Stheraven 712261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 713276792Sdiminline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return atanf(__lcpp_x);} 714276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return atanl(__lcpp_x);} 715227825Stheraven#endif 716227825Stheraven 717227825Stheraventemplate <class _A1> 718227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 719227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 720276792Sdimatan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);} 721227825Stheraven 722227825Stheraven// atan2 723227825Stheraven 724227825Stheravenusing ::atan2; 725227825Stheravenusing ::atan2f; 726227825Stheraven 727261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 728276792Sdiminline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return atan2f(__lcpp_y, __lcpp_x);} 729276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return atan2l(__lcpp_y, __lcpp_x);} 730227825Stheraven#endif 731227825Stheraven 732227825Stheraventemplate <class _A1, class _A2> 733227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 734276792Sdimtypename __lazy_enable_if 735227825Stheraven< 736227825Stheraven is_arithmetic<_A1>::value && 737227825Stheraven is_arithmetic<_A2>::value, 738276792Sdim __promote<_A1, _A2> 739227825Stheraven>::type 740276792Sdimatan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT 741227825Stheraven{ 742227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 743227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 744227825Stheraven is_same<_A2, __result_type>::value)), ""); 745276792Sdim return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x); 746227825Stheraven} 747227825Stheraven 748227825Stheraven// ceil 749227825Stheraven 750227825Stheravenusing ::ceil; 751227825Stheravenusing ::ceilf; 752227825Stheraven 753261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 754276792Sdiminline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ceilf(__lcpp_x);} 755276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ceill(__lcpp_x);} 756227825Stheraven#endif 757227825Stheraven 758227825Stheraventemplate <class _A1> 759227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 760227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 761276792Sdimceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);} 762227825Stheraven 763227825Stheraven// cos 764227825Stheraven 765227825Stheravenusing ::cos; 766227825Stheravenusing ::cosf; 767227825Stheraven 768261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 769276792Sdiminline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return cosf(__lcpp_x);} 770276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return cosl(__lcpp_x);} 771227825Stheraven#endif 772227825Stheraven 773227825Stheraventemplate <class _A1> 774261272Sdiminline _LIBCPP_INLINE_VISIBILITY 775227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 776276792Sdimcos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);} 777227825Stheraven 778227825Stheraven// cosh 779227825Stheraven 780227825Stheravenusing ::cosh; 781227825Stheravenusing ::coshf; 782227825Stheraven 783261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 784276792Sdiminline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return coshf(__lcpp_x);} 785276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return coshl(__lcpp_x);} 786227825Stheraven#endif 787227825Stheraven 788227825Stheraventemplate <class _A1> 789227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 790227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 791276792Sdimcosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);} 792227825Stheraven 793232924Stheraven#endif // __sun__ 794227825Stheraven// exp 795227825Stheraven 796227825Stheravenusing ::exp; 797227825Stheravenusing ::expf; 798227825Stheraven 799232924Stheraven#ifndef __sun__ 800232924Stheraven 801261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 802276792Sdiminline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return expf(__lcpp_x);} 803276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return expl(__lcpp_x);} 804227825Stheraven#endif 805227825Stheraven 806232924Stheraven 807227825Stheraventemplate <class _A1> 808227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 809227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 810276792Sdimexp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);} 811227825Stheraven 812227825Stheraven// fabs 813227825Stheraven 814227825Stheravenusing ::fabs; 815227825Stheravenusing ::fabsf; 816227825Stheraven 817261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 818276792Sdiminline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);} 819276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);} 820227825Stheraven#endif 821227825Stheraven 822227825Stheraventemplate <class _A1> 823227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 824227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 825276792Sdimfabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);} 826227825Stheraven 827227825Stheraven// floor 828227825Stheraven 829227825Stheravenusing ::floor; 830227825Stheravenusing ::floorf; 831227825Stheraven 832261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 833276792Sdiminline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return floorf(__lcpp_x);} 834276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return floorl(__lcpp_x);} 835227825Stheraven#endif 836227825Stheraven 837227825Stheraventemplate <class _A1> 838227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 839227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 840276792Sdimfloor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);} 841227825Stheraven 842227825Stheraven// fmod 843227825Stheraven 844232924Stheraven#endif //__sun__ 845227825Stheravenusing ::fmod; 846227825Stheravenusing ::fmodf; 847232924Stheraven#ifndef __sun__ 848227825Stheraven 849261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 850276792Sdiminline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmodf(__lcpp_x, __lcpp_y);} 851276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmodl(__lcpp_x, __lcpp_y);} 852227825Stheraven#endif 853227825Stheraven 854227825Stheraventemplate <class _A1, class _A2> 855227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 856276792Sdimtypename __lazy_enable_if 857227825Stheraven< 858227825Stheraven is_arithmetic<_A1>::value && 859227825Stheraven is_arithmetic<_A2>::value, 860276792Sdim __promote<_A1, _A2> 861227825Stheraven>::type 862276792Sdimfmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 863227825Stheraven{ 864227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 865227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 866227825Stheraven is_same<_A2, __result_type>::value)), ""); 867276792Sdim return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y); 868227825Stheraven} 869227825Stheraven 870232924Stheraven 871227825Stheraven// frexp 872227825Stheraven 873227825Stheravenusing ::frexp; 874227825Stheravenusing ::frexpf; 875227825Stheraven 876261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 877276792Sdiminline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpf(__lcpp_x, __lcpp_e);} 878276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpl(__lcpp_x, __lcpp_e);} 879227825Stheraven#endif 880227825Stheraven 881227825Stheraventemplate <class _A1> 882227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 883227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 884276792Sdimfrexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);} 885227825Stheraven 886227825Stheraven// ldexp 887227825Stheraven 888227825Stheravenusing ::ldexp; 889227825Stheravenusing ::ldexpf; 890227825Stheraven 891261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 892276792Sdiminline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpf(__lcpp_x, __lcpp_e);} 893276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpl(__lcpp_x, __lcpp_e);} 894227825Stheraven#endif 895227825Stheraven 896227825Stheraventemplate <class _A1> 897227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 898227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 899276792Sdimldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);} 900227825Stheraven 901227825Stheraven// log 902227825Stheraven 903232924Stheraven#endif // __sun__ 904227825Stheravenusing ::log; 905227825Stheravenusing ::logf; 906232924Stheraven#ifndef __sun__ 907227825Stheraven 908261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 909276792Sdiminline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return logf(__lcpp_x);} 910276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return logl(__lcpp_x);} 911227825Stheraven#endif 912227825Stheraven 913227825Stheraventemplate <class _A1> 914227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 915227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 916276792Sdimlog(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);} 917227825Stheraven 918232924Stheraven 919227825Stheraven// log10 920227825Stheraven 921227825Stheravenusing ::log10; 922227825Stheravenusing ::log10f; 923227825Stheraven 924261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 925276792Sdiminline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return log10f(__lcpp_x);} 926276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return log10l(__lcpp_x);} 927227825Stheraven#endif 928227825Stheraven 929227825Stheraventemplate <class _A1> 930227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 931227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 932276792Sdimlog10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);} 933227825Stheraven 934227825Stheraven// modf 935227825Stheraven 936227825Stheravenusing ::modf; 937227825Stheravenusing ::modff; 938227825Stheraven 939261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 940276792Sdiminline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return modff(__lcpp_x, __lcpp_y);} 941276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return modfl(__lcpp_x, __lcpp_y);} 942227825Stheraven#endif 943227825Stheraven 944227825Stheraven// pow 945227825Stheraven 946232924Stheraven#endif // __sun__ 947227825Stheravenusing ::pow; 948227825Stheravenusing ::powf; 949227825Stheraven 950232924Stheraven#ifndef __sun__ 951232924Stheraven 952261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 953276792Sdiminline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return powf(__lcpp_x, __lcpp_y);} 954276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);} 955227825Stheraven#endif 956227825Stheraven 957227825Stheraventemplate <class _A1, class _A2> 958227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 959276792Sdimtypename __lazy_enable_if 960227825Stheraven< 961227825Stheraven is_arithmetic<_A1>::value && 962227825Stheraven is_arithmetic<_A2>::value, 963276792Sdim __promote<_A1, _A2> 964227825Stheraven>::type 965276792Sdimpow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 966227825Stheraven{ 967227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 968227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 969227825Stheraven is_same<_A2, __result_type>::value)), ""); 970276792Sdim return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y); 971227825Stheraven} 972227825Stheraven 973227825Stheraven// sin 974227825Stheraven 975227825Stheravenusing ::sin; 976227825Stheravenusing ::sinf; 977227825Stheraven 978261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 979276792Sdiminline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return sinf(__lcpp_x);} 980276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return sinl(__lcpp_x);} 981227825Stheraven#endif 982227825Stheraven 983227825Stheraventemplate <class _A1> 984227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 985227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 986276792Sdimsin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);} 987227825Stheraven 988227825Stheraven// sinh 989227825Stheraven 990227825Stheravenusing ::sinh; 991227825Stheravenusing ::sinhf; 992227825Stheraven 993261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 994276792Sdiminline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return sinhf(__lcpp_x);} 995276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return sinhl(__lcpp_x);} 996227825Stheraven#endif 997227825Stheraven 998227825Stheraventemplate <class _A1> 999227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1000227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1001276792Sdimsinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);} 1002227825Stheraven 1003227825Stheraven// sqrt 1004227825Stheraven 1005232924Stheraven#endif // __sun__ 1006227825Stheravenusing ::sqrt; 1007227825Stheravenusing ::sqrtf; 1008227825Stheraven 1009232924Stheraven 1010261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX)) 1011276792Sdiminline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return sqrtf(__lcpp_x);} 1012276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return sqrtl(__lcpp_x);} 1013227825Stheraven#endif 1014227825Stheraven 1015227825Stheraventemplate <class _A1> 1016227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1017227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1018276792Sdimsqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);} 1019227825Stheraven 1020227825Stheraven// tan 1021227825Stheraven 1022227825Stheravenusing ::tan; 1023227825Stheravenusing ::tanf; 1024232924Stheraven#ifndef __sun__ 1025227825Stheraven 1026261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 1027276792Sdiminline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return tanf(__lcpp_x);} 1028276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return tanl(__lcpp_x);} 1029227825Stheraven#endif 1030227825Stheraven 1031227825Stheraventemplate <class _A1> 1032227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1033227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1034276792Sdimtan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);} 1035227825Stheraven 1036227825Stheraven// tanh 1037227825Stheraven 1038227825Stheravenusing ::tanh; 1039227825Stheravenusing ::tanhf; 1040227825Stheraven 1041261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 1042276792Sdiminline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return tanhf(__lcpp_x);} 1043276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return tanhl(__lcpp_x);} 1044227825Stheraven#endif 1045227825Stheraven 1046227825Stheraventemplate <class _A1> 1047227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1048227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1049276792Sdimtanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);} 1050227825Stheraven 1051227825Stheraven// acosh 1052227825Stheraven 1053261272Sdim#ifndef _LIBCPP_MSVCRT 1054227825Stheravenusing ::acosh; 1055227825Stheravenusing ::acoshf; 1056227825Stheraven 1057276792Sdiminline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return acoshf(__lcpp_x);} 1058276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);} 1059227825Stheraven 1060227825Stheraventemplate <class _A1> 1061227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1062227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1063276792Sdimacosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);} 1064227825Stheraven#endif 1065227825Stheraven 1066227825Stheraven// asinh 1067227825Stheraven 1068261272Sdim#ifndef _LIBCPP_MSVCRT 1069227825Stheravenusing ::asinh; 1070227825Stheravenusing ::asinhf; 1071227825Stheraven 1072276792Sdiminline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return asinhf(__lcpp_x);} 1073276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);} 1074227825Stheraven 1075227825Stheraventemplate <class _A1> 1076227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1077227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1078276792Sdimasinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);} 1079227825Stheraven#endif 1080227825Stheraven 1081227825Stheraven// atanh 1082227825Stheraven 1083261272Sdim#ifndef _LIBCPP_MSVCRT 1084227825Stheravenusing ::atanh; 1085227825Stheravenusing ::atanhf; 1086227825Stheraven 1087276792Sdiminline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return atanhf(__lcpp_x);} 1088276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);} 1089227825Stheraven 1090227825Stheraventemplate <class _A1> 1091227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1092227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1093276792Sdimatanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);} 1094227825Stheraven#endif 1095227825Stheraven 1096227825Stheraven// cbrt 1097227825Stheraven 1098261272Sdim#ifndef _LIBCPP_MSVCRT 1099227825Stheravenusing ::cbrt; 1100227825Stheravenusing ::cbrtf; 1101227825Stheraven 1102276792Sdiminline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return cbrtf(__lcpp_x);} 1103276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);} 1104227825Stheraven 1105227825Stheraventemplate <class _A1> 1106227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1107227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1108276792Sdimcbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);} 1109227825Stheraven#endif 1110227825Stheraven 1111227825Stheraven// copysign 1112227825Stheraven 1113227825Stheravenusing ::copysign; 1114227825Stheravenusing ::copysignf; 1115227825Stheraven 1116288943Sdim#if !defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12) 1117288943Sdiminline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x, 1118288943Sdim float __lcpp_y) _NOEXCEPT { 1119288943Sdim return copysignf(__lcpp_x, __lcpp_y); 1120288943Sdim} 1121288943Sdiminline _LIBCPP_INLINE_VISIBILITY long double 1122288943Sdimcopysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT { 1123288943Sdim return copysignl(__lcpp_x, __lcpp_y); 1124288943Sdim} 1125288943Sdim#endif 1126227825Stheraven 1127227825Stheraventemplate <class _A1, class _A2> 1128227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1129276792Sdimtypename __lazy_enable_if 1130227825Stheraven< 1131227825Stheraven is_arithmetic<_A1>::value && 1132227825Stheraven is_arithmetic<_A2>::value, 1133276792Sdim __promote<_A1, _A2> 1134227825Stheraven>::type 1135276792Sdimcopysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1136227825Stheraven{ 1137227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1138227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1139227825Stheraven is_same<_A2, __result_type>::value)), ""); 1140276792Sdim return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1141227825Stheraven} 1142227825Stheraven 1143261272Sdim#ifndef _LIBCPP_MSVCRT 1144227825Stheraven 1145227825Stheraven// erf 1146227825Stheraven 1147227825Stheravenusing ::erf; 1148227825Stheravenusing ::erff; 1149227825Stheraven 1150276792Sdiminline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return erff(__lcpp_x);} 1151276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);} 1152227825Stheraven 1153227825Stheraventemplate <class _A1> 1154227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1155227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1156276792Sdimerf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);} 1157227825Stheraven 1158227825Stheraven// erfc 1159227825Stheraven 1160227825Stheravenusing ::erfc; 1161227825Stheravenusing ::erfcf; 1162227825Stheraven 1163276792Sdiminline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return erfcf(__lcpp_x);} 1164276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);} 1165227825Stheraven 1166227825Stheraventemplate <class _A1> 1167227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1168227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1169276792Sdimerfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);} 1170227825Stheraven 1171227825Stheraven// exp2 1172227825Stheraven 1173227825Stheravenusing ::exp2; 1174227825Stheravenusing ::exp2f; 1175227825Stheraven 1176276792Sdiminline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return exp2f(__lcpp_x);} 1177276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);} 1178227825Stheraven 1179227825Stheraventemplate <class _A1> 1180227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1181227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1182276792Sdimexp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);} 1183227825Stheraven 1184227825Stheraven// expm1 1185227825Stheraven 1186227825Stheravenusing ::expm1; 1187227825Stheravenusing ::expm1f; 1188227825Stheraven 1189276792Sdiminline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return expm1f(__lcpp_x);} 1190276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);} 1191227825Stheraven 1192227825Stheraventemplate <class _A1> 1193227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1194227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1195276792Sdimexpm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);} 1196227825Stheraven 1197227825Stheraven// fdim 1198227825Stheraven 1199227825Stheravenusing ::fdim; 1200227825Stheravenusing ::fdimf; 1201227825Stheraven 1202276792Sdiminline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fdimf(__lcpp_x, __lcpp_y);} 1203276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);} 1204227825Stheraven 1205227825Stheraventemplate <class _A1, class _A2> 1206227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1207276792Sdimtypename __lazy_enable_if 1208227825Stheraven< 1209227825Stheraven is_arithmetic<_A1>::value && 1210227825Stheraven is_arithmetic<_A2>::value, 1211276792Sdim __promote<_A1, _A2> 1212227825Stheraven>::type 1213276792Sdimfdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1214227825Stheraven{ 1215227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1216227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1217227825Stheraven is_same<_A2, __result_type>::value)), ""); 1218276792Sdim return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1219227825Stheraven} 1220227825Stheraven 1221227825Stheraven// fma 1222227825Stheraven 1223276792Sdimusing ::fmaf; 1224227825Stheravenusing ::fma; 1225227825Stheraven 1226276792Sdiminline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);} 1227276792Sdiminline _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);} 1228227825Stheraven 1229227825Stheraventemplate <class _A1, class _A2, class _A3> 1230227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1231276792Sdimtypename __lazy_enable_if 1232227825Stheraven< 1233227825Stheraven is_arithmetic<_A1>::value && 1234227825Stheraven is_arithmetic<_A2>::value && 1235227825Stheraven is_arithmetic<_A3>::value, 1236276792Sdim __promote<_A1, _A2, _A3> 1237227825Stheraven>::type 1238276792Sdimfma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT 1239227825Stheraven{ 1240227825Stheraven typedef typename __promote<_A1, _A2, _A3>::type __result_type; 1241227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1242227825Stheraven is_same<_A2, __result_type>::value && 1243227825Stheraven is_same<_A3, __result_type>::value)), ""); 1244276792Sdim return fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z); 1245227825Stheraven} 1246227825Stheraven 1247227825Stheraven// fmax 1248227825Stheraven 1249227825Stheravenusing ::fmax; 1250227825Stheravenusing ::fmaxf; 1251227825Stheraven 1252276792Sdiminline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmaxf(__lcpp_x, __lcpp_y);} 1253276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);} 1254227825Stheraven 1255227825Stheraventemplate <class _A1, class _A2> 1256227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1257276792Sdimtypename __lazy_enable_if 1258227825Stheraven< 1259227825Stheraven is_arithmetic<_A1>::value && 1260227825Stheraven is_arithmetic<_A2>::value, 1261276792Sdim __promote<_A1, _A2> 1262227825Stheraven>::type 1263276792Sdimfmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1264227825Stheraven{ 1265227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1266227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1267227825Stheraven is_same<_A2, __result_type>::value)), ""); 1268276792Sdim return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1269227825Stheraven} 1270227825Stheraven 1271227825Stheraven// fmin 1272227825Stheraven 1273227825Stheravenusing ::fmin; 1274227825Stheravenusing ::fminf; 1275227825Stheraven 1276276792Sdiminline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fminf(__lcpp_x, __lcpp_y);} 1277276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);} 1278227825Stheraven 1279227825Stheraventemplate <class _A1, class _A2> 1280227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1281276792Sdimtypename __lazy_enable_if 1282227825Stheraven< 1283227825Stheraven is_arithmetic<_A1>::value && 1284227825Stheraven is_arithmetic<_A2>::value, 1285276792Sdim __promote<_A1, _A2> 1286227825Stheraven>::type 1287276792Sdimfmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1288227825Stheraven{ 1289227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1290227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1291227825Stheraven is_same<_A2, __result_type>::value)), ""); 1292276792Sdim return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1293227825Stheraven} 1294227825Stheraven 1295227825Stheraven// hypot 1296227825Stheraven 1297227825Stheravenusing ::hypot; 1298227825Stheravenusing ::hypotf; 1299227825Stheraven 1300276792Sdiminline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return hypotf(__lcpp_x, __lcpp_y);} 1301276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);} 1302227825Stheraven 1303227825Stheraventemplate <class _A1, class _A2> 1304227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1305276792Sdimtypename __lazy_enable_if 1306227825Stheraven< 1307227825Stheraven is_arithmetic<_A1>::value && 1308227825Stheraven is_arithmetic<_A2>::value, 1309276792Sdim __promote<_A1, _A2> 1310227825Stheraven>::type 1311276792Sdimhypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1312227825Stheraven{ 1313227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1314227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1315227825Stheraven is_same<_A2, __result_type>::value)), ""); 1316276792Sdim return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1317227825Stheraven} 1318227825Stheraven 1319227825Stheraven// ilogb 1320227825Stheraven 1321227825Stheravenusing ::ilogb; 1322227825Stheravenusing ::ilogbf; 1323227825Stheraven 1324276792Sdiminline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ilogbf(__lcpp_x);} 1325276792Sdiminline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);} 1326227825Stheraven 1327227825Stheraventemplate <class _A1> 1328227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1329227825Stheraventypename enable_if<is_integral<_A1>::value, int>::type 1330276792Sdimilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);} 1331227825Stheraven 1332227825Stheraven// lgamma 1333227825Stheraven 1334227825Stheravenusing ::lgamma; 1335227825Stheravenusing ::lgammaf; 1336227825Stheraven 1337276792Sdiminline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return lgammaf(__lcpp_x);} 1338276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);} 1339227825Stheraven 1340232924Stheraven 1341227825Stheraventemplate <class _A1> 1342227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1343227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1344276792Sdimlgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);} 1345227825Stheraven 1346232924Stheraven 1347227825Stheraven// llrint 1348227825Stheraven 1349227825Stheravenusing ::llrint; 1350227825Stheravenusing ::llrintf; 1351227825Stheraven 1352276792Sdiminline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);} 1353276792Sdiminline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);} 1354227825Stheraven 1355227825Stheraventemplate <class _A1> 1356227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1357227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type 1358276792Sdimllrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);} 1359227825Stheraven 1360227825Stheraven// llround 1361227825Stheraven 1362227825Stheravenusing ::llround; 1363227825Stheravenusing ::llroundf; 1364227825Stheraven 1365276792Sdiminline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return llroundf(__lcpp_x);} 1366276792Sdiminline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);} 1367227825Stheraven 1368227825Stheraventemplate <class _A1> 1369227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1370227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type 1371276792Sdimllround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);} 1372227825Stheraven 1373227825Stheraven// log1p 1374227825Stheraven 1375227825Stheravenusing ::log1p; 1376227825Stheravenusing ::log1pf; 1377227825Stheraven 1378276792Sdiminline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return log1pf(__lcpp_x);} 1379276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);} 1380227825Stheraven 1381227825Stheraventemplate <class _A1> 1382227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1383227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1384276792Sdimlog1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);} 1385227825Stheraven 1386227825Stheraven// log2 1387227825Stheraven 1388227825Stheravenusing ::log2; 1389227825Stheravenusing ::log2f; 1390227825Stheraven 1391276792Sdiminline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return log2f(__lcpp_x);} 1392276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);} 1393227825Stheraven 1394227825Stheraventemplate <class _A1> 1395227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1396227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1397276792Sdimlog2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);} 1398227825Stheraven 1399227825Stheraven// logb 1400227825Stheraven 1401227825Stheravenusing ::logb; 1402227825Stheravenusing ::logbf; 1403227825Stheraven 1404276792Sdiminline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return logbf(__lcpp_x);} 1405276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);} 1406227825Stheraven 1407227825Stheraventemplate <class _A1> 1408227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1409227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1410276792Sdimlogb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);} 1411227825Stheraven 1412227825Stheraven// lrint 1413227825Stheraven 1414227825Stheravenusing ::lrint; 1415227825Stheravenusing ::lrintf; 1416227825Stheraven 1417276792Sdiminline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return lrintf(__lcpp_x);} 1418276792Sdiminline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);} 1419227825Stheraven 1420227825Stheraventemplate <class _A1> 1421227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1422227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type 1423276792Sdimlrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);} 1424227825Stheraven 1425227825Stheraven// lround 1426227825Stheraven 1427227825Stheravenusing ::lround; 1428227825Stheravenusing ::lroundf; 1429227825Stheraven 1430276792Sdiminline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return lroundf(__lcpp_x);} 1431276792Sdiminline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);} 1432227825Stheraven 1433227825Stheraventemplate <class _A1> 1434227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1435227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type 1436276792Sdimlround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);} 1437227825Stheraven 1438261272Sdim#endif // _LIBCPP_MSVCRT 1439261272Sdim#endif // __sun__ 1440261272Sdim 1441227825Stheraven// nan 1442261272Sdim 1443261272Sdim#ifndef _LIBCPP_MSVCRT 1444227825Stheravenusing ::nan; 1445227825Stheravenusing ::nanf; 1446261272Sdim#endif // _LIBCPP_MSVCRT 1447261272Sdim 1448232924Stheraven#ifndef __sun__ 1449261272Sdim#ifndef _LIBCPP_MSVCRT 1450227825Stheraven 1451227825Stheraven// nearbyint 1452227825Stheraven 1453227825Stheravenusing ::nearbyint; 1454227825Stheravenusing ::nearbyintf; 1455227825Stheraven 1456276792Sdiminline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return nearbyintf(__lcpp_x);} 1457276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);} 1458227825Stheraven 1459227825Stheraventemplate <class _A1> 1460227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1461227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1462276792Sdimnearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);} 1463227825Stheraven 1464227825Stheraven// nextafter 1465227825Stheraven 1466227825Stheravenusing ::nextafter; 1467227825Stheravenusing ::nextafterf; 1468227825Stheraven 1469276792Sdiminline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return nextafterf(__lcpp_x, __lcpp_y);} 1470276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);} 1471227825Stheraven 1472227825Stheraventemplate <class _A1, class _A2> 1473227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1474276792Sdimtypename __lazy_enable_if 1475227825Stheraven< 1476227825Stheraven is_arithmetic<_A1>::value && 1477227825Stheraven is_arithmetic<_A2>::value, 1478276792Sdim __promote<_A1, _A2> 1479227825Stheraven>::type 1480276792Sdimnextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1481227825Stheraven{ 1482227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1483227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1484227825Stheraven is_same<_A2, __result_type>::value)), ""); 1485276792Sdim return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1486227825Stheraven} 1487227825Stheraven 1488227825Stheraven// nexttoward 1489227825Stheraven 1490227825Stheravenusing ::nexttoward; 1491227825Stheravenusing ::nexttowardf; 1492227825Stheraven 1493276792Sdiminline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardf(__lcpp_x, __lcpp_y);} 1494276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);} 1495227825Stheraven 1496227825Stheraventemplate <class _A1> 1497227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1498227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1499276792Sdimnexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);} 1500227825Stheraven 1501227825Stheraven// remainder 1502227825Stheraven 1503227825Stheravenusing ::remainder; 1504227825Stheravenusing ::remainderf; 1505227825Stheraven 1506276792Sdiminline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return remainderf(__lcpp_x, __lcpp_y);} 1507276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);} 1508227825Stheraven 1509227825Stheraventemplate <class _A1, class _A2> 1510227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1511276792Sdimtypename __lazy_enable_if 1512227825Stheraven< 1513227825Stheraven is_arithmetic<_A1>::value && 1514227825Stheraven is_arithmetic<_A2>::value, 1515276792Sdim __promote<_A1, _A2> 1516227825Stheraven>::type 1517276792Sdimremainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT 1518227825Stheraven{ 1519227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1520227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1521227825Stheraven is_same<_A2, __result_type>::value)), ""); 1522276792Sdim return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y); 1523227825Stheraven} 1524227825Stheraven 1525227825Stheraven// remquo 1526227825Stheraven 1527227825Stheravenusing ::remquo; 1528227825Stheravenusing ::remquof; 1529227825Stheraven 1530276792Sdiminline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);} 1531276792Sdiminline _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);} 1532227825Stheraven 1533227825Stheraventemplate <class _A1, class _A2> 1534227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1535276792Sdimtypename __lazy_enable_if 1536227825Stheraven< 1537227825Stheraven is_arithmetic<_A1>::value && 1538227825Stheraven is_arithmetic<_A2>::value, 1539276792Sdim __promote<_A1, _A2> 1540227825Stheraven>::type 1541276792Sdimremquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT 1542227825Stheraven{ 1543227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1544227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1545227825Stheraven is_same<_A2, __result_type>::value)), ""); 1546276792Sdim return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z); 1547227825Stheraven} 1548227825Stheraven 1549227825Stheraven// rint 1550227825Stheraven 1551227825Stheravenusing ::rint; 1552227825Stheravenusing ::rintf; 1553227825Stheraven 1554276792Sdiminline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return rintf(__lcpp_x);} 1555276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);} 1556227825Stheraven 1557227825Stheraventemplate <class _A1> 1558227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1559227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1560276792Sdimrint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);} 1561227825Stheraven 1562227825Stheraven// round 1563227825Stheraven 1564227825Stheravenusing ::round; 1565227825Stheravenusing ::roundf; 1566227825Stheraven 1567276792Sdiminline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return roundf(__lcpp_x);} 1568276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);} 1569227825Stheraven 1570227825Stheraventemplate <class _A1> 1571227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1572227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1573276792Sdimround(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);} 1574227825Stheraven 1575227825Stheraven// scalbln 1576227825Stheraven 1577227825Stheravenusing ::scalbln; 1578227825Stheravenusing ::scalblnf; 1579227825Stheraven 1580276792Sdiminline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnf(__lcpp_x, __lcpp_y);} 1581276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);} 1582227825Stheraven 1583227825Stheraventemplate <class _A1> 1584227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1585227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1586276792Sdimscalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);} 1587227825Stheraven 1588227825Stheraven// scalbn 1589227825Stheraven 1590227825Stheravenusing ::scalbn; 1591227825Stheravenusing ::scalbnf; 1592227825Stheraven 1593276792Sdiminline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnf(__lcpp_x, __lcpp_y);} 1594276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);} 1595227825Stheraven 1596227825Stheraventemplate <class _A1> 1597227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1598227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1599276792Sdimscalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);} 1600227825Stheraven 1601227825Stheraven// tgamma 1602227825Stheraven 1603227825Stheravenusing ::tgamma; 1604227825Stheravenusing ::tgammaf; 1605227825Stheraven 1606276792Sdiminline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return tgammaf(__lcpp_x);} 1607276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);} 1608227825Stheraven 1609227825Stheraventemplate <class _A1> 1610227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1611227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1612276792Sdimtgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);} 1613227825Stheraven 1614227825Stheraven// trunc 1615227825Stheraven 1616227825Stheravenusing ::trunc; 1617227825Stheravenusing ::truncf; 1618227825Stheraven 1619276792Sdiminline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return truncf(__lcpp_x);} 1620276792Sdiminline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);} 1621227825Stheraven 1622227825Stheraventemplate <class _A1> 1623227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1624227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1625276792Sdimtrunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);} 1626227825Stheraven 1627261272Sdim#endif // !_LIBCPP_MSVCRT 1628227825Stheraven 1629227825Stheravenusing ::acosl; 1630227825Stheravenusing ::asinl; 1631227825Stheravenusing ::atanl; 1632227825Stheravenusing ::atan2l; 1633227825Stheravenusing ::ceill; 1634227825Stheravenusing ::cosl; 1635227825Stheravenusing ::coshl; 1636227825Stheravenusing ::expl; 1637227825Stheravenusing ::fabsl; 1638227825Stheravenusing ::floorl; 1639227825Stheravenusing ::fmodl; 1640227825Stheravenusing ::frexpl; 1641227825Stheravenusing ::ldexpl; 1642227825Stheravenusing ::logl; 1643227825Stheravenusing ::log10l; 1644227825Stheravenusing ::modfl; 1645227825Stheravenusing ::powl; 1646227825Stheravenusing ::sinl; 1647227825Stheravenusing ::sinhl; 1648227825Stheravenusing ::sqrtl; 1649227825Stheravenusing ::tanl; 1650261272Sdim#ifndef _LIBCPP_MSVCRT 1651227825Stheravenusing ::tanhl; 1652227825Stheravenusing ::acoshl; 1653227825Stheravenusing ::asinhl; 1654227825Stheravenusing ::atanhl; 1655227825Stheravenusing ::cbrtl; 1656261272Sdim#endif // !_LIBCPP_MSVCRT 1657227825Stheravenusing ::copysignl; 1658261272Sdim#ifndef _LIBCPP_MSVCRT 1659227825Stheravenusing ::erfl; 1660227825Stheravenusing ::erfcl; 1661227825Stheravenusing ::exp2l; 1662227825Stheravenusing ::expm1l; 1663227825Stheravenusing ::fdiml; 1664227825Stheravenusing ::fmal; 1665227825Stheravenusing ::fmaxl; 1666227825Stheravenusing ::fminl; 1667227825Stheravenusing ::hypotl; 1668227825Stheravenusing ::ilogbl; 1669227825Stheravenusing ::lgammal; 1670227825Stheravenusing ::llrintl; 1671227825Stheravenusing ::llroundl; 1672227825Stheravenusing ::log1pl; 1673227825Stheravenusing ::log2l; 1674227825Stheravenusing ::logbl; 1675227825Stheravenusing ::lrintl; 1676227825Stheravenusing ::lroundl; 1677227825Stheravenusing ::nanl; 1678227825Stheravenusing ::nearbyintl; 1679227825Stheravenusing ::nextafterl; 1680227825Stheravenusing ::nexttowardl; 1681227825Stheravenusing ::remainderl; 1682227825Stheravenusing ::remquol; 1683227825Stheravenusing ::rintl; 1684227825Stheravenusing ::roundl; 1685227825Stheravenusing ::scalblnl; 1686227825Stheravenusing ::scalbnl; 1687227825Stheravenusing ::tgammal; 1688227825Stheravenusing ::truncl; 1689261272Sdim#endif // !_LIBCPP_MSVCRT 1690227825Stheraven 1691232924Stheraven#else 1692232924Stheravenusing ::lgamma; 1693232924Stheravenusing ::lgammaf; 1694232924Stheraven#endif // __sun__ 1695227825Stheraven_LIBCPP_END_NAMESPACE_STD 1696227825Stheraven 1697227825Stheraven#endif // _LIBCPP_CMATH 1698