cmath revision 261272
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 319241900Sdim__libcpp_signbit(_A1 __x) _NOEXCEPT 320227825Stheraven{ 321227825Stheraven return signbit(__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 329241900Sdimsignbit(_A1 __x) _NOEXCEPT 330227825Stheraven{ 331246468Stheraven return __libcpp_signbit((typename std::__promote<_A1>::type)__x); 332227825Stheraven} 333227825Stheraven 334227825Stheraven#endif // signbit 335227825Stheraven 336227825Stheraven// fpclassify 337227825Stheraven 338227825Stheraven#ifdef fpclassify 339227825Stheraven 340227825Stheraventemplate <class _A1> 341227825Stheraven_LIBCPP_ALWAYS_INLINE 342227825Stheravenint 343241900Sdim__libcpp_fpclassify(_A1 __x) _NOEXCEPT 344227825Stheraven{ 345227825Stheraven return fpclassify(__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 353241900Sdimfpclassify(_A1 __x) _NOEXCEPT 354227825Stheraven{ 355246468Stheraven return __libcpp_fpclassify((typename std::__promote<_A1>::type)__x); 356227825Stheraven} 357227825Stheraven 358227825Stheraven#endif // fpclassify 359227825Stheraven 360227825Stheraven// isfinite 361227825Stheraven 362227825Stheraven#ifdef isfinite 363227825Stheraven 364227825Stheraventemplate <class _A1> 365227825Stheraven_LIBCPP_ALWAYS_INLINE 366227825Stheravenbool 367241900Sdim__libcpp_isfinite(_A1 __x) _NOEXCEPT 368227825Stheraven{ 369227825Stheraven return isfinite(__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 377241900Sdimisfinite(_A1 __x) _NOEXCEPT 378227825Stheraven{ 379246468Stheraven return __libcpp_isfinite((typename std::__promote<_A1>::type)__x); 380227825Stheraven} 381227825Stheraven 382227825Stheraven#endif // isfinite 383227825Stheraven 384227825Stheraven// isinf 385227825Stheraven 386227825Stheraven#ifdef isinf 387227825Stheraven 388227825Stheraventemplate <class _A1> 389227825Stheraven_LIBCPP_ALWAYS_INLINE 390227825Stheravenbool 391241900Sdim__libcpp_isinf(_A1 __x) _NOEXCEPT 392227825Stheraven{ 393227825Stheraven return isinf(__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 401241900Sdimisinf(_A1 __x) _NOEXCEPT 402227825Stheraven{ 403246468Stheraven return __libcpp_isinf((typename std::__promote<_A1>::type)__x); 404227825Stheraven} 405227825Stheraven 406227825Stheraven#endif // isinf 407227825Stheraven 408227825Stheraven// isnan 409227825Stheraven 410227825Stheraven#ifdef isnan 411227825Stheraven 412227825Stheraventemplate <class _A1> 413227825Stheraven_LIBCPP_ALWAYS_INLINE 414227825Stheravenbool 415241900Sdim__libcpp_isnan(_A1 __x) _NOEXCEPT 416227825Stheraven{ 417227825Stheraven return isnan(__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 425241900Sdimisnan(_A1 __x) _NOEXCEPT 426227825Stheraven{ 427246468Stheraven return __libcpp_isnan((typename std::__promote<_A1>::type)__x); 428227825Stheraven} 429227825Stheraven 430227825Stheraven#endif // isnan 431227825Stheraven 432227825Stheraven// isnormal 433227825Stheraven 434227825Stheraven#ifdef isnormal 435227825Stheraven 436227825Stheraventemplate <class _A1> 437227825Stheraven_LIBCPP_ALWAYS_INLINE 438227825Stheravenbool 439241900Sdim__libcpp_isnormal(_A1 __x) _NOEXCEPT 440227825Stheraven{ 441227825Stheraven return isnormal(__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 449241900Sdimisnormal(_A1 __x) _NOEXCEPT 450227825Stheraven{ 451246468Stheraven return __libcpp_isnormal((typename std::__promote<_A1>::type)__x); 452227825Stheraven} 453227825Stheraven 454227825Stheraven#endif // isnormal 455227825Stheraven 456227825Stheraven// isgreater 457227825Stheraven 458227825Stheraven#ifdef isgreater 459227825Stheraven 460227825Stheraventemplate <class _A1, class _A2> 461227825Stheraven_LIBCPP_ALWAYS_INLINE 462227825Stheravenbool 463241900Sdim__libcpp_isgreater(_A1 __x, _A2 __y) _NOEXCEPT 464227825Stheraven{ 465227825Stheraven return isgreater(__x, __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 478241900Sdimisgreater(_A1 __x, _A2 __y) _NOEXCEPT 479227825Stheraven{ 480246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 481246468Stheraven return __libcpp_isgreater((type)__x, (type)__y); 482227825Stheraven} 483227825Stheraven 484227825Stheraven#endif // isgreater 485227825Stheraven 486227825Stheraven// isgreaterequal 487227825Stheraven 488227825Stheraven#ifdef isgreaterequal 489227825Stheraven 490227825Stheraventemplate <class _A1, class _A2> 491227825Stheraven_LIBCPP_ALWAYS_INLINE 492227825Stheravenbool 493241900Sdim__libcpp_isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT 494227825Stheraven{ 495227825Stheraven return isgreaterequal(__x, __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 508241900Sdimisgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT 509227825Stheraven{ 510246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 511246468Stheraven return __libcpp_isgreaterequal((type)__x, (type)__y); 512227825Stheraven} 513227825Stheraven 514227825Stheraven#endif // isgreaterequal 515227825Stheraven 516227825Stheraven// isless 517227825Stheraven 518227825Stheraven#ifdef isless 519227825Stheraven 520227825Stheraventemplate <class _A1, class _A2> 521227825Stheraven_LIBCPP_ALWAYS_INLINE 522227825Stheravenbool 523241900Sdim__libcpp_isless(_A1 __x, _A2 __y) _NOEXCEPT 524227825Stheraven{ 525227825Stheraven return isless(__x, __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 538241900Sdimisless(_A1 __x, _A2 __y) _NOEXCEPT 539227825Stheraven{ 540246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 541246468Stheraven return __libcpp_isless((type)__x, (type)__y); 542227825Stheraven} 543227825Stheraven 544227825Stheraven#endif // isless 545227825Stheraven 546227825Stheraven// islessequal 547227825Stheraven 548227825Stheraven#ifdef islessequal 549227825Stheraven 550227825Stheraventemplate <class _A1, class _A2> 551227825Stheraven_LIBCPP_ALWAYS_INLINE 552227825Stheravenbool 553241900Sdim__libcpp_islessequal(_A1 __x, _A2 __y) _NOEXCEPT 554227825Stheraven{ 555227825Stheraven return islessequal(__x, __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 568241900Sdimislessequal(_A1 __x, _A2 __y) _NOEXCEPT 569227825Stheraven{ 570246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 571246468Stheraven return __libcpp_islessequal((type)__x, (type)__y); 572227825Stheraven} 573227825Stheraven 574227825Stheraven#endif // islessequal 575227825Stheraven 576227825Stheraven// islessgreater 577227825Stheraven 578227825Stheraven#ifdef islessgreater 579227825Stheraven 580227825Stheraventemplate <class _A1, class _A2> 581227825Stheraven_LIBCPP_ALWAYS_INLINE 582227825Stheravenbool 583241900Sdim__libcpp_islessgreater(_A1 __x, _A2 __y) _NOEXCEPT 584227825Stheraven{ 585227825Stheraven return islessgreater(__x, __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 598241900Sdimislessgreater(_A1 __x, _A2 __y) _NOEXCEPT 599227825Stheraven{ 600246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 601246468Stheraven return __libcpp_islessgreater((type)__x, (type)__y); 602227825Stheraven} 603227825Stheraven 604227825Stheraven#endif // islessgreater 605227825Stheraven 606227825Stheraven// isunordered 607227825Stheraven 608227825Stheraven#ifdef isunordered 609227825Stheraven 610227825Stheraventemplate <class _A1, class _A2> 611227825Stheraven_LIBCPP_ALWAYS_INLINE 612227825Stheravenbool 613241900Sdim__libcpp_isunordered(_A1 __x, _A2 __y) _NOEXCEPT 614227825Stheraven{ 615227825Stheraven return isunordered(__x, __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 628241900Sdimisunordered(_A1 __x, _A2 __y) _NOEXCEPT 629227825Stheraven{ 630246468Stheraven typedef typename std::__promote<_A1, _A2>::type type; 631246468Stheraven return __libcpp_isunordered((type)__x, (type)__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 657261272Sdim#if !defined(_AIX) 658227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 659234959Stheravenfloat 660241900Sdimabs(float __x) _NOEXCEPT {return fabsf(__x);} 661227825Stheraven 662234959Stheraveninline _LIBCPP_INLINE_VISIBILITY 663234959Stheravendouble 664241900Sdimabs(double __x) _NOEXCEPT {return fabs(__x);} 665234959Stheraven 666234959Stheraveninline _LIBCPP_INLINE_VISIBILITY 667234959Stheravenlong double 668241900Sdimabs(long double __x) _NOEXCEPT {return fabsl(__x);} 669261272Sdim#endif // !defined(_AIX) 670234959Stheraven 671232924Stheraven#ifndef __sun__ 672232924Stheraven 673227825Stheraven// acos 674227825Stheraven 675227825Stheravenusing ::acos; 676227825Stheravenusing ::acosf; 677227825Stheraven 678261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 679241900Sdiminline _LIBCPP_INLINE_VISIBILITY float acos(float __x) _NOEXCEPT {return acosf(__x);} 680241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) _NOEXCEPT {return acosl(__x);} 681227825Stheraven#endif 682227825Stheraven 683227825Stheraventemplate <class _A1> 684227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 685227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 686241900Sdimacos(_A1 __x) _NOEXCEPT {return acos((double)__x);} 687227825Stheraven 688227825Stheraven// asin 689227825Stheraven 690227825Stheravenusing ::asin; 691227825Stheravenusing ::asinf; 692227825Stheraven 693261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 694241900Sdiminline _LIBCPP_INLINE_VISIBILITY float asin(float __x) _NOEXCEPT {return asinf(__x);} 695241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) _NOEXCEPT {return asinl(__x);} 696227825Stheraven#endif 697227825Stheraven 698227825Stheraventemplate <class _A1> 699227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 700227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 701241900Sdimasin(_A1 __x) _NOEXCEPT {return asin((double)__x);} 702227825Stheraven 703227825Stheraven// atan 704227825Stheraven 705227825Stheravenusing ::atan; 706227825Stheravenusing ::atanf; 707227825Stheraven 708261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 709241900Sdiminline _LIBCPP_INLINE_VISIBILITY float atan(float __x) _NOEXCEPT {return atanf(__x);} 710241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) _NOEXCEPT {return atanl(__x);} 711227825Stheraven#endif 712227825Stheraven 713227825Stheraventemplate <class _A1> 714227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 715227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 716241900Sdimatan(_A1 __x) _NOEXCEPT {return atan((double)__x);} 717227825Stheraven 718227825Stheraven// atan2 719227825Stheraven 720227825Stheravenusing ::atan2; 721227825Stheravenusing ::atan2f; 722227825Stheraven 723261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 724241900Sdiminline _LIBCPP_INLINE_VISIBILITY float atan2(float __y, float __x) _NOEXCEPT {return atan2f(__y, __x);} 725241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) _NOEXCEPT {return atan2l(__y, __x);} 726227825Stheraven#endif 727227825Stheraven 728227825Stheraventemplate <class _A1, class _A2> 729227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 730227825Stheraventypename enable_if 731227825Stheraven< 732227825Stheraven is_arithmetic<_A1>::value && 733227825Stheraven is_arithmetic<_A2>::value, 734227825Stheraven typename __promote<_A1, _A2>::type 735227825Stheraven>::type 736241900Sdimatan2(_A1 __y, _A2 __x) _NOEXCEPT 737227825Stheraven{ 738227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 739227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 740227825Stheraven is_same<_A2, __result_type>::value)), ""); 741227825Stheraven return atan2((__result_type)__y, (__result_type)__x); 742227825Stheraven} 743227825Stheraven 744227825Stheraven// ceil 745227825Stheraven 746227825Stheravenusing ::ceil; 747227825Stheravenusing ::ceilf; 748227825Stheraven 749261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 750241900Sdiminline _LIBCPP_INLINE_VISIBILITY float ceil(float __x) _NOEXCEPT {return ceilf(__x);} 751241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) _NOEXCEPT {return ceill(__x);} 752227825Stheraven#endif 753227825Stheraven 754227825Stheraventemplate <class _A1> 755227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 756227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 757241900Sdimceil(_A1 __x) _NOEXCEPT {return ceil((double)__x);} 758227825Stheraven 759227825Stheraven// cos 760227825Stheraven 761227825Stheravenusing ::cos; 762227825Stheravenusing ::cosf; 763227825Stheraven 764261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 765241900Sdiminline _LIBCPP_INLINE_VISIBILITY float cos(float __x) _NOEXCEPT {return cosf(__x);} 766241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) _NOEXCEPT {return cosl(__x);} 767227825Stheraven#endif 768227825Stheraven 769227825Stheraventemplate <class _A1> 770261272Sdiminline _LIBCPP_INLINE_VISIBILITY 771227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 772241900Sdimcos(_A1 __x) _NOEXCEPT {return cos((double)__x);} 773227825Stheraven 774227825Stheraven// cosh 775227825Stheraven 776227825Stheravenusing ::cosh; 777227825Stheravenusing ::coshf; 778227825Stheraven 779261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 780241900Sdiminline _LIBCPP_INLINE_VISIBILITY float cosh(float __x) _NOEXCEPT {return coshf(__x);} 781241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) _NOEXCEPT {return coshl(__x);} 782227825Stheraven#endif 783227825Stheraven 784227825Stheraventemplate <class _A1> 785227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 786227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 787241900Sdimcosh(_A1 __x) _NOEXCEPT {return cosh((double)__x);} 788227825Stheraven 789232924Stheraven#endif // __sun__ 790227825Stheraven// exp 791227825Stheraven 792227825Stheravenusing ::exp; 793227825Stheravenusing ::expf; 794227825Stheraven 795232924Stheraven#ifndef __sun__ 796232924Stheraven 797261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 798241900Sdiminline _LIBCPP_INLINE_VISIBILITY float exp(float __x) _NOEXCEPT {return expf(__x);} 799241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) _NOEXCEPT {return expl(__x);} 800227825Stheraven#endif 801227825Stheraven 802232924Stheraven 803227825Stheraventemplate <class _A1> 804227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 805227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 806241900Sdimexp(_A1 __x) _NOEXCEPT {return exp((double)__x);} 807227825Stheraven 808227825Stheraven// fabs 809227825Stheraven 810227825Stheravenusing ::fabs; 811227825Stheravenusing ::fabsf; 812227825Stheraven 813261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 814241900Sdiminline _LIBCPP_INLINE_VISIBILITY float fabs(float __x) _NOEXCEPT {return fabsf(__x);} 815241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) _NOEXCEPT {return fabsl(__x);} 816227825Stheraven#endif 817227825Stheraven 818227825Stheraventemplate <class _A1> 819227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 820227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 821241900Sdimfabs(_A1 __x) _NOEXCEPT {return fabs((double)__x);} 822227825Stheraven 823227825Stheraven// floor 824227825Stheraven 825227825Stheravenusing ::floor; 826227825Stheravenusing ::floorf; 827227825Stheraven 828261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 829241900Sdiminline _LIBCPP_INLINE_VISIBILITY float floor(float __x) _NOEXCEPT {return floorf(__x);} 830241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) _NOEXCEPT {return floorl(__x);} 831227825Stheraven#endif 832227825Stheraven 833227825Stheraventemplate <class _A1> 834227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 835227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 836241900Sdimfloor(_A1 __x) _NOEXCEPT {return floor((double)__x);} 837227825Stheraven 838227825Stheraven// fmod 839227825Stheraven 840232924Stheraven#endif //__sun__ 841227825Stheravenusing ::fmod; 842227825Stheravenusing ::fmodf; 843232924Stheraven#ifndef __sun__ 844227825Stheraven 845261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 846241900Sdiminline _LIBCPP_INLINE_VISIBILITY float fmod(float __x, float __y) _NOEXCEPT {return fmodf(__x, __y);} 847241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) _NOEXCEPT {return fmodl(__x, __y);} 848227825Stheraven#endif 849227825Stheraven 850227825Stheraventemplate <class _A1, class _A2> 851227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 852227825Stheraventypename enable_if 853227825Stheraven< 854227825Stheraven is_arithmetic<_A1>::value && 855227825Stheraven is_arithmetic<_A2>::value, 856227825Stheraven typename __promote<_A1, _A2>::type 857227825Stheraven>::type 858241900Sdimfmod(_A1 __x, _A2 __y) _NOEXCEPT 859227825Stheraven{ 860227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 861227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 862227825Stheraven is_same<_A2, __result_type>::value)), ""); 863227825Stheraven return fmod((__result_type)__x, (__result_type)__y); 864227825Stheraven} 865227825Stheraven 866232924Stheraven 867227825Stheraven// frexp 868227825Stheraven 869227825Stheravenusing ::frexp; 870227825Stheravenusing ::frexpf; 871227825Stheraven 872261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 873241900Sdiminline _LIBCPP_INLINE_VISIBILITY float frexp(float __x, int* __e) _NOEXCEPT {return frexpf(__x, __e);} 874241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) _NOEXCEPT {return frexpl(__x, __e);} 875227825Stheraven#endif 876227825Stheraven 877227825Stheraventemplate <class _A1> 878227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 879227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 880241900Sdimfrexp(_A1 __x, int* __e) _NOEXCEPT {return frexp((double)__x, __e);} 881227825Stheraven 882227825Stheraven// ldexp 883227825Stheraven 884227825Stheravenusing ::ldexp; 885227825Stheravenusing ::ldexpf; 886227825Stheraven 887261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 888241900Sdiminline _LIBCPP_INLINE_VISIBILITY float ldexp(float __x, int __e) _NOEXCEPT {return ldexpf(__x, __e);} 889241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) _NOEXCEPT {return ldexpl(__x, __e);} 890227825Stheraven#endif 891227825Stheraven 892227825Stheraventemplate <class _A1> 893227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 894227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 895241900Sdimldexp(_A1 __x, int __e) _NOEXCEPT {return ldexp((double)__x, __e);} 896227825Stheraven 897227825Stheraven// log 898227825Stheraven 899232924Stheraven#endif // __sun__ 900227825Stheravenusing ::log; 901227825Stheravenusing ::logf; 902232924Stheraven#ifndef __sun__ 903227825Stheraven 904261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 905241900Sdiminline _LIBCPP_INLINE_VISIBILITY float log(float __x) _NOEXCEPT {return logf(__x);} 906241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) _NOEXCEPT {return logl(__x);} 907227825Stheraven#endif 908227825Stheraven 909227825Stheraventemplate <class _A1> 910227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 911227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 912241900Sdimlog(_A1 __x) _NOEXCEPT {return log((double)__x);} 913227825Stheraven 914232924Stheraven 915227825Stheraven// log10 916227825Stheraven 917227825Stheravenusing ::log10; 918227825Stheravenusing ::log10f; 919227825Stheraven 920261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 921241900Sdiminline _LIBCPP_INLINE_VISIBILITY float log10(float __x) _NOEXCEPT {return log10f(__x);} 922241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) _NOEXCEPT {return log10l(__x);} 923227825Stheraven#endif 924227825Stheraven 925227825Stheraventemplate <class _A1> 926227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 927227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 928241900Sdimlog10(_A1 __x) _NOEXCEPT {return log10((double)__x);} 929227825Stheraven 930227825Stheraven// modf 931227825Stheraven 932227825Stheravenusing ::modf; 933227825Stheravenusing ::modff; 934227825Stheraven 935261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 936241900Sdiminline _LIBCPP_INLINE_VISIBILITY float modf(float __x, float* __y) _NOEXCEPT {return modff(__x, __y);} 937241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) _NOEXCEPT {return modfl(__x, __y);} 938227825Stheraven#endif 939227825Stheraven 940227825Stheraven// pow 941227825Stheraven 942232924Stheraven#endif // __sun__ 943227825Stheravenusing ::pow; 944227825Stheravenusing ::powf; 945227825Stheraven 946232924Stheraven#ifndef __sun__ 947232924Stheraven 948261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 949241900Sdiminline _LIBCPP_INLINE_VISIBILITY float pow(float __x, float __y) _NOEXCEPT {return powf(__x, __y);} 950241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) _NOEXCEPT {return powl(__x, __y);} 951227825Stheraven#endif 952227825Stheraven 953227825Stheraventemplate <class _A1, class _A2> 954227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 955227825Stheraventypename enable_if 956227825Stheraven< 957227825Stheraven is_arithmetic<_A1>::value && 958227825Stheraven is_arithmetic<_A2>::value, 959227825Stheraven typename __promote<_A1, _A2>::type 960227825Stheraven>::type 961241900Sdimpow(_A1 __x, _A2 __y) _NOEXCEPT 962227825Stheraven{ 963227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 964227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 965227825Stheraven is_same<_A2, __result_type>::value)), ""); 966227825Stheraven return pow((__result_type)__x, (__result_type)__y); 967227825Stheraven} 968227825Stheraven 969232924Stheraven 970227825Stheraven// sin 971227825Stheraven 972227825Stheravenusing ::sin; 973227825Stheravenusing ::sinf; 974227825Stheraven 975261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 976241900Sdiminline _LIBCPP_INLINE_VISIBILITY float sin(float __x) _NOEXCEPT {return sinf(__x);} 977241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) _NOEXCEPT {return sinl(__x);} 978227825Stheraven#endif 979227825Stheraven 980227825Stheraventemplate <class _A1> 981227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 982227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 983241900Sdimsin(_A1 __x) _NOEXCEPT {return sin((double)__x);} 984227825Stheraven 985227825Stheraven// sinh 986227825Stheraven 987227825Stheravenusing ::sinh; 988227825Stheravenusing ::sinhf; 989227825Stheraven 990261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 991241900Sdiminline _LIBCPP_INLINE_VISIBILITY float sinh(float __x) _NOEXCEPT {return sinhf(__x);} 992241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) _NOEXCEPT {return sinhl(__x);} 993227825Stheraven#endif 994227825Stheraven 995227825Stheraventemplate <class _A1> 996227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 997227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 998241900Sdimsinh(_A1 __x) _NOEXCEPT {return sinh((double)__x);} 999227825Stheraven 1000227825Stheraven// sqrt 1001227825Stheraven 1002232924Stheraven#endif // __sun__ 1003227825Stheravenusing ::sqrt; 1004227825Stheravenusing ::sqrtf; 1005227825Stheraven 1006232924Stheraven 1007261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX)) 1008241900Sdiminline _LIBCPP_INLINE_VISIBILITY float sqrt(float __x) _NOEXCEPT {return sqrtf(__x);} 1009241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) _NOEXCEPT {return sqrtl(__x);} 1010227825Stheraven#endif 1011227825Stheraven 1012227825Stheraventemplate <class _A1> 1013227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1014227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1015241900Sdimsqrt(_A1 __x) _NOEXCEPT {return sqrt((double)__x);} 1016227825Stheraven 1017227825Stheraven// tan 1018227825Stheraven 1019227825Stheravenusing ::tan; 1020227825Stheravenusing ::tanf; 1021232924Stheraven#ifndef __sun__ 1022227825Stheraven 1023261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 1024241900Sdiminline _LIBCPP_INLINE_VISIBILITY float tan(float __x) _NOEXCEPT {return tanf(__x);} 1025241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) _NOEXCEPT {return tanl(__x);} 1026227825Stheraven#endif 1027227825Stheraven 1028227825Stheraventemplate <class _A1> 1029227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1030227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1031241900Sdimtan(_A1 __x) _NOEXCEPT {return tan((double)__x);} 1032227825Stheraven 1033227825Stheraven// tanh 1034227825Stheraven 1035227825Stheravenusing ::tanh; 1036227825Stheravenusing ::tanhf; 1037227825Stheraven 1038261272Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) 1039241900Sdiminline _LIBCPP_INLINE_VISIBILITY float tanh(float __x) _NOEXCEPT {return tanhf(__x);} 1040241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) _NOEXCEPT {return tanhl(__x);} 1041227825Stheraven#endif 1042227825Stheraven 1043227825Stheraventemplate <class _A1> 1044227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1045227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1046241900Sdimtanh(_A1 __x) _NOEXCEPT {return tanh((double)__x);} 1047227825Stheraven 1048227825Stheraven// acosh 1049227825Stheraven 1050261272Sdim#ifndef _LIBCPP_MSVCRT 1051227825Stheravenusing ::acosh; 1052227825Stheravenusing ::acoshf; 1053227825Stheraven 1054241900Sdiminline _LIBCPP_INLINE_VISIBILITY float acosh(float __x) _NOEXCEPT {return acoshf(__x);} 1055241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) _NOEXCEPT {return acoshl(__x);} 1056227825Stheraven 1057227825Stheraventemplate <class _A1> 1058227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1059227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1060241900Sdimacosh(_A1 __x) _NOEXCEPT {return acosh((double)__x);} 1061227825Stheraven#endif 1062227825Stheraven 1063227825Stheraven// asinh 1064227825Stheraven 1065261272Sdim#ifndef _LIBCPP_MSVCRT 1066227825Stheravenusing ::asinh; 1067227825Stheravenusing ::asinhf; 1068227825Stheraven 1069241900Sdiminline _LIBCPP_INLINE_VISIBILITY float asinh(float __x) _NOEXCEPT {return asinhf(__x);} 1070241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) _NOEXCEPT {return asinhl(__x);} 1071227825Stheraven 1072227825Stheraventemplate <class _A1> 1073227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1074227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1075241900Sdimasinh(_A1 __x) _NOEXCEPT {return asinh((double)__x);} 1076227825Stheraven#endif 1077227825Stheraven 1078227825Stheraven// atanh 1079227825Stheraven 1080261272Sdim#ifndef _LIBCPP_MSVCRT 1081227825Stheravenusing ::atanh; 1082227825Stheravenusing ::atanhf; 1083227825Stheraven 1084241900Sdiminline _LIBCPP_INLINE_VISIBILITY float atanh(float __x) _NOEXCEPT {return atanhf(__x);} 1085241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) _NOEXCEPT {return atanhl(__x);} 1086227825Stheraven 1087227825Stheraventemplate <class _A1> 1088227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1089227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1090241900Sdimatanh(_A1 __x) _NOEXCEPT {return atanh((double)__x);} 1091227825Stheraven#endif 1092227825Stheraven 1093227825Stheraven// cbrt 1094227825Stheraven 1095261272Sdim#ifndef _LIBCPP_MSVCRT 1096227825Stheravenusing ::cbrt; 1097227825Stheravenusing ::cbrtf; 1098227825Stheraven 1099241900Sdiminline _LIBCPP_INLINE_VISIBILITY float cbrt(float __x) _NOEXCEPT {return cbrtf(__x);} 1100241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) _NOEXCEPT {return cbrtl(__x);} 1101227825Stheraven 1102227825Stheraventemplate <class _A1> 1103227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1104227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1105241900Sdimcbrt(_A1 __x) _NOEXCEPT {return cbrt((double)__x);} 1106227825Stheraven#endif 1107227825Stheraven 1108227825Stheraven// copysign 1109227825Stheraven 1110227825Stheravenusing ::copysign; 1111227825Stheravenusing ::copysignf; 1112227825Stheraven 1113241900Sdiminline _LIBCPP_INLINE_VISIBILITY float copysign(float __x, float __y) _NOEXCEPT {return copysignf(__x, __y);} 1114241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) _NOEXCEPT {return copysignl(__x, __y);} 1115227825Stheraven 1116227825Stheraventemplate <class _A1, class _A2> 1117227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1118227825Stheraventypename enable_if 1119227825Stheraven< 1120227825Stheraven is_arithmetic<_A1>::value && 1121227825Stheraven is_arithmetic<_A2>::value, 1122227825Stheraven typename __promote<_A1, _A2>::type 1123227825Stheraven>::type 1124241900Sdimcopysign(_A1 __x, _A2 __y) _NOEXCEPT 1125227825Stheraven{ 1126227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1127227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1128227825Stheraven is_same<_A2, __result_type>::value)), ""); 1129227825Stheraven return copysign((__result_type)__x, (__result_type)__y); 1130227825Stheraven} 1131227825Stheraven 1132261272Sdim#ifndef _LIBCPP_MSVCRT 1133227825Stheraven 1134227825Stheraven// erf 1135227825Stheraven 1136227825Stheravenusing ::erf; 1137227825Stheravenusing ::erff; 1138227825Stheraven 1139241900Sdiminline _LIBCPP_INLINE_VISIBILITY float erf(float __x) _NOEXCEPT {return erff(__x);} 1140241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) _NOEXCEPT {return erfl(__x);} 1141227825Stheraven 1142227825Stheraventemplate <class _A1> 1143227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1144227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1145241900Sdimerf(_A1 __x) _NOEXCEPT {return erf((double)__x);} 1146227825Stheraven 1147227825Stheraven// erfc 1148227825Stheraven 1149227825Stheravenusing ::erfc; 1150227825Stheravenusing ::erfcf; 1151227825Stheraven 1152241900Sdiminline _LIBCPP_INLINE_VISIBILITY float erfc(float __x) _NOEXCEPT {return erfcf(__x);} 1153241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) _NOEXCEPT {return erfcl(__x);} 1154227825Stheraven 1155227825Stheraventemplate <class _A1> 1156227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1157227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1158241900Sdimerfc(_A1 __x) _NOEXCEPT {return erfc((double)__x);} 1159227825Stheraven 1160227825Stheraven// exp2 1161227825Stheraven 1162227825Stheravenusing ::exp2; 1163227825Stheravenusing ::exp2f; 1164227825Stheraven 1165241900Sdiminline _LIBCPP_INLINE_VISIBILITY float exp2(float __x) _NOEXCEPT {return exp2f(__x);} 1166241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) _NOEXCEPT {return exp2l(__x);} 1167227825Stheraven 1168227825Stheraventemplate <class _A1> 1169227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1170227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1171241900Sdimexp2(_A1 __x) _NOEXCEPT {return exp2((double)__x);} 1172227825Stheraven 1173227825Stheraven// expm1 1174227825Stheraven 1175227825Stheravenusing ::expm1; 1176227825Stheravenusing ::expm1f; 1177227825Stheraven 1178241900Sdiminline _LIBCPP_INLINE_VISIBILITY float expm1(float __x) _NOEXCEPT {return expm1f(__x);} 1179241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) _NOEXCEPT {return expm1l(__x);} 1180227825Stheraven 1181227825Stheraventemplate <class _A1> 1182227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1183227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1184241900Sdimexpm1(_A1 __x) _NOEXCEPT {return expm1((double)__x);} 1185227825Stheraven 1186227825Stheraven// fdim 1187227825Stheraven 1188227825Stheravenusing ::fdim; 1189227825Stheravenusing ::fdimf; 1190227825Stheraven 1191241900Sdiminline _LIBCPP_INLINE_VISIBILITY float fdim(float __x, float __y) _NOEXCEPT {return fdimf(__x, __y);} 1192241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) _NOEXCEPT {return fdiml(__x, __y);} 1193227825Stheraven 1194227825Stheraventemplate <class _A1, class _A2> 1195227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1196227825Stheraventypename enable_if 1197227825Stheraven< 1198227825Stheraven is_arithmetic<_A1>::value && 1199227825Stheraven is_arithmetic<_A2>::value, 1200227825Stheraven typename __promote<_A1, _A2>::type 1201227825Stheraven>::type 1202241900Sdimfdim(_A1 __x, _A2 __y) _NOEXCEPT 1203227825Stheraven{ 1204227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1205227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1206227825Stheraven is_same<_A2, __result_type>::value)), ""); 1207227825Stheraven return fdim((__result_type)__x, (__result_type)__y); 1208227825Stheraven} 1209227825Stheraven 1210227825Stheraven// fma 1211227825Stheraven 1212241900Sdiminline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) _NOEXCEPT {return (float)((double)__x*__y + __z);} 1213242939Stheraven#ifndef FP_FAST_FMAF 1214227825Stheraven#define FP_FAST_FMAF 1215242939Stheraven#endif 1216227825Stheraven 1217227825Stheravenusing ::fma; 1218227825Stheraven 1219241900Sdiminline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) _NOEXCEPT {return fmaf(__x, __y, __z);} 1220241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) _NOEXCEPT {return fmal(__x, __y, __z);} 1221227825Stheraven 1222227825Stheraventemplate <class _A1, class _A2, class _A3> 1223227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1224227825Stheraventypename enable_if 1225227825Stheraven< 1226227825Stheraven is_arithmetic<_A1>::value && 1227227825Stheraven is_arithmetic<_A2>::value && 1228227825Stheraven is_arithmetic<_A3>::value, 1229227825Stheraven typename __promote<_A1, _A2, _A3>::type 1230227825Stheraven>::type 1231241900Sdimfma(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT 1232227825Stheraven{ 1233227825Stheraven typedef typename __promote<_A1, _A2, _A3>::type __result_type; 1234227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1235227825Stheraven is_same<_A2, __result_type>::value && 1236227825Stheraven is_same<_A3, __result_type>::value)), ""); 1237227825Stheraven return fma((__result_type)__x, (__result_type)__y, (__result_type)__z); 1238227825Stheraven} 1239227825Stheraven 1240227825Stheraven// fmax 1241227825Stheraven 1242227825Stheravenusing ::fmax; 1243227825Stheravenusing ::fmaxf; 1244227825Stheraven 1245241900Sdiminline _LIBCPP_INLINE_VISIBILITY float fmax(float __x, float __y) _NOEXCEPT {return fmaxf(__x, __y);} 1246241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) _NOEXCEPT {return fmaxl(__x, __y);} 1247227825Stheraven 1248227825Stheraventemplate <class _A1, class _A2> 1249227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1250227825Stheraventypename enable_if 1251227825Stheraven< 1252227825Stheraven is_arithmetic<_A1>::value && 1253227825Stheraven is_arithmetic<_A2>::value, 1254227825Stheraven typename __promote<_A1, _A2>::type 1255227825Stheraven>::type 1256241900Sdimfmax(_A1 __x, _A2 __y) _NOEXCEPT 1257227825Stheraven{ 1258227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1259227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1260227825Stheraven is_same<_A2, __result_type>::value)), ""); 1261227825Stheraven return fmax((__result_type)__x, (__result_type)__y); 1262227825Stheraven} 1263227825Stheraven 1264227825Stheraven// fmin 1265227825Stheraven 1266227825Stheravenusing ::fmin; 1267227825Stheravenusing ::fminf; 1268227825Stheraven 1269241900Sdiminline _LIBCPP_INLINE_VISIBILITY float fmin(float __x, float __y) _NOEXCEPT {return fminf(__x, __y);} 1270241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) _NOEXCEPT {return fminl(__x, __y);} 1271227825Stheraven 1272227825Stheraventemplate <class _A1, class _A2> 1273227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1274227825Stheraventypename enable_if 1275227825Stheraven< 1276227825Stheraven is_arithmetic<_A1>::value && 1277227825Stheraven is_arithmetic<_A2>::value, 1278227825Stheraven typename __promote<_A1, _A2>::type 1279227825Stheraven>::type 1280241900Sdimfmin(_A1 __x, _A2 __y) _NOEXCEPT 1281227825Stheraven{ 1282227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1283227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1284227825Stheraven is_same<_A2, __result_type>::value)), ""); 1285227825Stheraven return fmin((__result_type)__x, (__result_type)__y); 1286227825Stheraven} 1287227825Stheraven 1288227825Stheraven// hypot 1289227825Stheraven 1290227825Stheravenusing ::hypot; 1291227825Stheravenusing ::hypotf; 1292227825Stheraven 1293241900Sdiminline _LIBCPP_INLINE_VISIBILITY float hypot(float __x, float __y) _NOEXCEPT {return hypotf(__x, __y);} 1294241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) _NOEXCEPT {return hypotl(__x, __y);} 1295227825Stheraven 1296227825Stheraventemplate <class _A1, class _A2> 1297227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1298227825Stheraventypename enable_if 1299227825Stheraven< 1300227825Stheraven is_arithmetic<_A1>::value && 1301227825Stheraven is_arithmetic<_A2>::value, 1302227825Stheraven typename __promote<_A1, _A2>::type 1303227825Stheraven>::type 1304241900Sdimhypot(_A1 __x, _A2 __y) _NOEXCEPT 1305227825Stheraven{ 1306227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1307227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1308227825Stheraven is_same<_A2, __result_type>::value)), ""); 1309227825Stheraven return hypot((__result_type)__x, (__result_type)__y); 1310227825Stheraven} 1311227825Stheraven 1312227825Stheraven// ilogb 1313227825Stheraven 1314227825Stheravenusing ::ilogb; 1315227825Stheravenusing ::ilogbf; 1316227825Stheraven 1317241900Sdiminline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x) _NOEXCEPT {return ilogbf(__x);} 1318241900Sdiminline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) _NOEXCEPT {return ilogbl(__x);} 1319227825Stheraven 1320227825Stheraventemplate <class _A1> 1321227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1322227825Stheraventypename enable_if<is_integral<_A1>::value, int>::type 1323241900Sdimilogb(_A1 __x) _NOEXCEPT {return ilogb((double)__x);} 1324227825Stheraven 1325227825Stheraven// lgamma 1326227825Stheraven 1327227825Stheravenusing ::lgamma; 1328227825Stheravenusing ::lgammaf; 1329227825Stheraven 1330241900Sdiminline _LIBCPP_INLINE_VISIBILITY float lgamma(float __x) _NOEXCEPT {return lgammaf(__x);} 1331241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) _NOEXCEPT {return lgammal(__x);} 1332227825Stheraven 1333232924Stheraven 1334227825Stheraventemplate <class _A1> 1335227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1336227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1337241900Sdimlgamma(_A1 __x) _NOEXCEPT {return lgamma((double)__x);} 1338227825Stheraven 1339232924Stheraven 1340227825Stheraven// llrint 1341227825Stheraven 1342227825Stheravenusing ::llrint; 1343227825Stheravenusing ::llrintf; 1344227825Stheraven 1345241900Sdiminline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) _NOEXCEPT {return llrintf(__x);} 1346241900Sdiminline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) _NOEXCEPT {return llrintl(__x);} 1347227825Stheraven 1348227825Stheraventemplate <class _A1> 1349227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1350227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type 1351241900Sdimllrint(_A1 __x) _NOEXCEPT {return llrint((double)__x);} 1352227825Stheraven 1353227825Stheraven// llround 1354227825Stheraven 1355227825Stheravenusing ::llround; 1356227825Stheravenusing ::llroundf; 1357227825Stheraven 1358241900Sdiminline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) _NOEXCEPT {return llroundf(__x);} 1359241900Sdiminline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) _NOEXCEPT {return llroundl(__x);} 1360227825Stheraven 1361227825Stheraventemplate <class _A1> 1362227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1363227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type 1364241900Sdimllround(_A1 __x) _NOEXCEPT {return llround((double)__x);} 1365227825Stheraven 1366227825Stheraven// log1p 1367227825Stheraven 1368227825Stheravenusing ::log1p; 1369227825Stheravenusing ::log1pf; 1370227825Stheraven 1371241900Sdiminline _LIBCPP_INLINE_VISIBILITY float log1p(float __x) _NOEXCEPT {return log1pf(__x);} 1372241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) _NOEXCEPT {return log1pl(__x);} 1373227825Stheraven 1374227825Stheraventemplate <class _A1> 1375227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1376227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1377241900Sdimlog1p(_A1 __x) _NOEXCEPT {return log1p((double)__x);} 1378227825Stheraven 1379227825Stheraven// log2 1380227825Stheraven 1381227825Stheravenusing ::log2; 1382227825Stheravenusing ::log2f; 1383227825Stheraven 1384241900Sdiminline _LIBCPP_INLINE_VISIBILITY float log2(float __x) _NOEXCEPT {return log2f(__x);} 1385241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) _NOEXCEPT {return log2l(__x);} 1386227825Stheraven 1387227825Stheraventemplate <class _A1> 1388227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1389227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1390241900Sdimlog2(_A1 __x) _NOEXCEPT {return log2((double)__x);} 1391227825Stheraven 1392227825Stheraven// logb 1393227825Stheraven 1394227825Stheravenusing ::logb; 1395227825Stheravenusing ::logbf; 1396227825Stheraven 1397241900Sdiminline _LIBCPP_INLINE_VISIBILITY float logb(float __x) _NOEXCEPT {return logbf(__x);} 1398241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) _NOEXCEPT {return logbl(__x);} 1399227825Stheraven 1400227825Stheraventemplate <class _A1> 1401227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1402227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1403241900Sdimlogb(_A1 __x) _NOEXCEPT {return logb((double)__x);} 1404227825Stheraven 1405227825Stheraven// lrint 1406227825Stheraven 1407227825Stheravenusing ::lrint; 1408227825Stheravenusing ::lrintf; 1409227825Stheraven 1410241900Sdiminline _LIBCPP_INLINE_VISIBILITY long lrint(float __x) _NOEXCEPT {return lrintf(__x);} 1411241900Sdiminline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) _NOEXCEPT {return lrintl(__x);} 1412227825Stheraven 1413227825Stheraventemplate <class _A1> 1414227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1415227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type 1416241900Sdimlrint(_A1 __x) _NOEXCEPT {return lrint((double)__x);} 1417227825Stheraven 1418227825Stheraven// lround 1419227825Stheraven 1420227825Stheravenusing ::lround; 1421227825Stheravenusing ::lroundf; 1422227825Stheraven 1423241900Sdiminline _LIBCPP_INLINE_VISIBILITY long lround(float __x) _NOEXCEPT {return lroundf(__x);} 1424241900Sdiminline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) _NOEXCEPT {return lroundl(__x);} 1425227825Stheraven 1426227825Stheraventemplate <class _A1> 1427227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1428227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type 1429241900Sdimlround(_A1 __x) _NOEXCEPT {return lround((double)__x);} 1430227825Stheraven 1431261272Sdim#endif // _LIBCPP_MSVCRT 1432261272Sdim#endif // __sun__ 1433261272Sdim 1434227825Stheraven// nan 1435261272Sdim 1436261272Sdim#ifndef _LIBCPP_MSVCRT 1437227825Stheravenusing ::nan; 1438227825Stheravenusing ::nanf; 1439261272Sdim#endif // _LIBCPP_MSVCRT 1440261272Sdim 1441232924Stheraven#ifndef __sun__ 1442261272Sdim#ifndef _LIBCPP_MSVCRT 1443227825Stheraven 1444227825Stheraven// nearbyint 1445227825Stheraven 1446227825Stheravenusing ::nearbyint; 1447227825Stheravenusing ::nearbyintf; 1448227825Stheraven 1449241900Sdiminline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __x) _NOEXCEPT {return nearbyintf(__x);} 1450241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) _NOEXCEPT {return nearbyintl(__x);} 1451227825Stheraven 1452227825Stheraventemplate <class _A1> 1453227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1454227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1455241900Sdimnearbyint(_A1 __x) _NOEXCEPT {return nearbyint((double)__x);} 1456227825Stheraven 1457227825Stheraven// nextafter 1458227825Stheraven 1459227825Stheravenusing ::nextafter; 1460227825Stheravenusing ::nextafterf; 1461227825Stheraven 1462241900Sdiminline _LIBCPP_INLINE_VISIBILITY float nextafter(float __x, float __y) _NOEXCEPT {return nextafterf(__x, __y);} 1463241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) _NOEXCEPT {return nextafterl(__x, __y);} 1464227825Stheraven 1465227825Stheraventemplate <class _A1, class _A2> 1466227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1467227825Stheraventypename enable_if 1468227825Stheraven< 1469227825Stheraven is_arithmetic<_A1>::value && 1470227825Stheraven is_arithmetic<_A2>::value, 1471227825Stheraven typename __promote<_A1, _A2>::type 1472227825Stheraven>::type 1473241900Sdimnextafter(_A1 __x, _A2 __y) _NOEXCEPT 1474227825Stheraven{ 1475227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1476227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1477227825Stheraven is_same<_A2, __result_type>::value)), ""); 1478227825Stheraven return nextafter((__result_type)__x, (__result_type)__y); 1479227825Stheraven} 1480227825Stheraven 1481227825Stheraven// nexttoward 1482227825Stheraven 1483227825Stheravenusing ::nexttoward; 1484227825Stheravenusing ::nexttowardf; 1485227825Stheraven 1486241900Sdiminline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __x, long double __y) _NOEXCEPT {return nexttowardf(__x, __y);} 1487241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) _NOEXCEPT {return nexttowardl(__x, __y);} 1488227825Stheraven 1489227825Stheraventemplate <class _A1> 1490227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1491227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1492241900Sdimnexttoward(_A1 __x, long double __y) _NOEXCEPT {return nexttoward((double)__x, __y);} 1493227825Stheraven 1494227825Stheraven// remainder 1495227825Stheraven 1496227825Stheravenusing ::remainder; 1497227825Stheravenusing ::remainderf; 1498227825Stheraven 1499241900Sdiminline _LIBCPP_INLINE_VISIBILITY float remainder(float __x, float __y) _NOEXCEPT {return remainderf(__x, __y);} 1500241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) _NOEXCEPT {return remainderl(__x, __y);} 1501227825Stheraven 1502227825Stheraventemplate <class _A1, class _A2> 1503227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1504227825Stheraventypename enable_if 1505227825Stheraven< 1506227825Stheraven is_arithmetic<_A1>::value && 1507227825Stheraven is_arithmetic<_A2>::value, 1508227825Stheraven typename __promote<_A1, _A2>::type 1509227825Stheraven>::type 1510241900Sdimremainder(_A1 __x, _A2 __y) _NOEXCEPT 1511227825Stheraven{ 1512227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1513227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1514227825Stheraven is_same<_A2, __result_type>::value)), ""); 1515227825Stheraven return remainder((__result_type)__x, (__result_type)__y); 1516227825Stheraven} 1517227825Stheraven 1518227825Stheraven// remquo 1519227825Stheraven 1520227825Stheravenusing ::remquo; 1521227825Stheravenusing ::remquof; 1522227825Stheraven 1523241900Sdiminline _LIBCPP_INLINE_VISIBILITY float remquo(float __x, float __y, int* __z) _NOEXCEPT {return remquof(__x, __y, __z);} 1524241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) _NOEXCEPT {return remquol(__x, __y, __z);} 1525227825Stheraven 1526227825Stheraventemplate <class _A1, class _A2> 1527227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1528227825Stheraventypename enable_if 1529227825Stheraven< 1530227825Stheraven is_arithmetic<_A1>::value && 1531227825Stheraven is_arithmetic<_A2>::value, 1532227825Stheraven typename __promote<_A1, _A2>::type 1533227825Stheraven>::type 1534241900Sdimremquo(_A1 __x, _A2 __y, int* __z) _NOEXCEPT 1535227825Stheraven{ 1536227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1537227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1538227825Stheraven is_same<_A2, __result_type>::value)), ""); 1539227825Stheraven return remquo((__result_type)__x, (__result_type)__y, __z); 1540227825Stheraven} 1541227825Stheraven 1542227825Stheraven// rint 1543227825Stheraven 1544227825Stheravenusing ::rint; 1545227825Stheravenusing ::rintf; 1546227825Stheraven 1547241900Sdiminline _LIBCPP_INLINE_VISIBILITY float rint(float __x) _NOEXCEPT {return rintf(__x);} 1548241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) _NOEXCEPT {return rintl(__x);} 1549227825Stheraven 1550227825Stheraventemplate <class _A1> 1551227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1552227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1553241900Sdimrint(_A1 __x) _NOEXCEPT {return rint((double)__x);} 1554227825Stheraven 1555227825Stheraven// round 1556227825Stheraven 1557227825Stheravenusing ::round; 1558227825Stheravenusing ::roundf; 1559227825Stheraven 1560241900Sdiminline _LIBCPP_INLINE_VISIBILITY float round(float __x) _NOEXCEPT {return roundf(__x);} 1561241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) _NOEXCEPT {return roundl(__x);} 1562227825Stheraven 1563227825Stheraventemplate <class _A1> 1564227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1565227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1566241900Sdimround(_A1 __x) _NOEXCEPT {return round((double)__x);} 1567227825Stheraven 1568227825Stheraven// scalbln 1569227825Stheraven 1570227825Stheravenusing ::scalbln; 1571227825Stheravenusing ::scalblnf; 1572227825Stheraven 1573241900Sdiminline _LIBCPP_INLINE_VISIBILITY float scalbln(float __x, long __y) _NOEXCEPT {return scalblnf(__x, __y);} 1574241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) _NOEXCEPT {return scalblnl(__x, __y);} 1575227825Stheraven 1576227825Stheraventemplate <class _A1> 1577227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1578227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1579241900Sdimscalbln(_A1 __x, long __y) _NOEXCEPT {return scalbln((double)__x, __y);} 1580227825Stheraven 1581227825Stheraven// scalbn 1582227825Stheraven 1583227825Stheravenusing ::scalbn; 1584227825Stheravenusing ::scalbnf; 1585227825Stheraven 1586241900Sdiminline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) _NOEXCEPT {return scalbnf(__x, __y);} 1587241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) _NOEXCEPT {return scalbnl(__x, __y);} 1588227825Stheraven 1589227825Stheraventemplate <class _A1> 1590227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1591227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1592241900Sdimscalbn(_A1 __x, int __y) _NOEXCEPT {return scalbn((double)__x, __y);} 1593227825Stheraven 1594227825Stheraven// tgamma 1595227825Stheraven 1596227825Stheravenusing ::tgamma; 1597227825Stheravenusing ::tgammaf; 1598227825Stheraven 1599241900Sdiminline _LIBCPP_INLINE_VISIBILITY float tgamma(float __x) _NOEXCEPT {return tgammaf(__x);} 1600241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) _NOEXCEPT {return tgammal(__x);} 1601227825Stheraven 1602227825Stheraventemplate <class _A1> 1603227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1604227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1605241900Sdimtgamma(_A1 __x) _NOEXCEPT {return tgamma((double)__x);} 1606227825Stheraven 1607227825Stheraven// trunc 1608227825Stheraven 1609227825Stheravenusing ::trunc; 1610227825Stheravenusing ::truncf; 1611227825Stheraven 1612241900Sdiminline _LIBCPP_INLINE_VISIBILITY float trunc(float __x) _NOEXCEPT {return truncf(__x);} 1613241900Sdiminline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) _NOEXCEPT {return truncl(__x);} 1614227825Stheraven 1615227825Stheraventemplate <class _A1> 1616227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1617227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1618241900Sdimtrunc(_A1 __x) _NOEXCEPT {return trunc((double)__x);} 1619227825Stheraven 1620261272Sdim#endif // !_LIBCPP_MSVCRT 1621227825Stheraven 1622227825Stheravenusing ::acosl; 1623227825Stheravenusing ::asinl; 1624227825Stheravenusing ::atanl; 1625227825Stheravenusing ::atan2l; 1626227825Stheravenusing ::ceill; 1627227825Stheravenusing ::cosl; 1628227825Stheravenusing ::coshl; 1629227825Stheravenusing ::expl; 1630227825Stheravenusing ::fabsl; 1631227825Stheravenusing ::floorl; 1632227825Stheravenusing ::fmodl; 1633227825Stheravenusing ::frexpl; 1634227825Stheravenusing ::ldexpl; 1635227825Stheravenusing ::logl; 1636227825Stheravenusing ::log10l; 1637227825Stheravenusing ::modfl; 1638227825Stheravenusing ::powl; 1639227825Stheravenusing ::sinl; 1640227825Stheravenusing ::sinhl; 1641227825Stheravenusing ::sqrtl; 1642227825Stheravenusing ::tanl; 1643261272Sdim#ifndef _LIBCPP_MSVCRT 1644227825Stheravenusing ::tanhl; 1645227825Stheravenusing ::acoshl; 1646227825Stheravenusing ::asinhl; 1647227825Stheravenusing ::atanhl; 1648227825Stheravenusing ::cbrtl; 1649261272Sdim#endif // !_LIBCPP_MSVCRT 1650227825Stheravenusing ::copysignl; 1651261272Sdim#ifndef _LIBCPP_MSVCRT 1652227825Stheravenusing ::erfl; 1653227825Stheravenusing ::erfcl; 1654227825Stheravenusing ::exp2l; 1655227825Stheravenusing ::expm1l; 1656227825Stheravenusing ::fdiml; 1657227825Stheravenusing ::fmal; 1658227825Stheravenusing ::fmaxl; 1659227825Stheravenusing ::fminl; 1660227825Stheravenusing ::hypotl; 1661227825Stheravenusing ::ilogbl; 1662227825Stheravenusing ::lgammal; 1663227825Stheravenusing ::llrintl; 1664227825Stheravenusing ::llroundl; 1665227825Stheravenusing ::log1pl; 1666227825Stheravenusing ::log2l; 1667227825Stheravenusing ::logbl; 1668227825Stheravenusing ::lrintl; 1669227825Stheravenusing ::lroundl; 1670227825Stheravenusing ::nanl; 1671227825Stheravenusing ::nearbyintl; 1672227825Stheravenusing ::nextafterl; 1673227825Stheravenusing ::nexttowardl; 1674227825Stheravenusing ::remainderl; 1675227825Stheravenusing ::remquol; 1676227825Stheravenusing ::rintl; 1677227825Stheravenusing ::roundl; 1678227825Stheravenusing ::scalblnl; 1679227825Stheravenusing ::scalbnl; 1680227825Stheravenusing ::tgammal; 1681227825Stheravenusing ::truncl; 1682261272Sdim#endif // !_LIBCPP_MSVCRT 1683227825Stheraven 1684232924Stheraven#else 1685232924Stheravenusing ::lgamma; 1686232924Stheravenusing ::lgammaf; 1687232924Stheraven#endif // __sun__ 1688227825Stheraven_LIBCPP_END_NAMESPACE_STD 1689227825Stheraven 1690227825Stheraven#endif // _LIBCPP_CMATH 1691