cmath revision 232950
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 140227825Stheravenbool signbit(floating_point x); 141227825Stheraven 142227825Stheravenint fpclassify(floating_point x); 143227825Stheraven 144227825Stheravenbool isfinite(floating_point x); 145227825Stheravenbool isinf(floating_point x); 146227825Stheravenbool isnan(floating_point x); 147227825Stheravenbool isnormal(floating_point x); 148227825Stheraven 149227825Stheravenbool isgreater(floating_point x, floating_point y); 150227825Stheravenbool isgreaterequal(floating_point x, floating_point y); 151227825Stheravenbool isless(floating_point x, floating_point y); 152227825Stheravenbool islessequal(floating_point x, floating_point y); 153227825Stheravenbool islessgreater(floating_point x, floating_point y); 154227825Stheravenbool isunordered(floating_point x, floating_point 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 304227825Stheraven#ifdef _MSC_VER 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 319227825Stheraven__libcpp_signbit(_A1 __x) 320227825Stheraven{ 321227825Stheraven return signbit(__x); 322227825Stheraven} 323227825Stheraven 324227825Stheraven#undef signbit 325227825Stheraven 326227825Stheraventemplate <class _A1> 327227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 328227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 329227825Stheravensignbit(_A1 __x) 330227825Stheraven{ 331227825Stheraven return __libcpp_signbit(__x); 332227825Stheraven} 333227825Stheraven 334227825Stheraven#endif // signbit 335227825Stheraven 336227825Stheraven// fpclassify 337227825Stheraven 338227825Stheraven#ifdef fpclassify 339227825Stheraven 340227825Stheraventemplate <class _A1> 341227825Stheraven_LIBCPP_ALWAYS_INLINE 342227825Stheravenint 343227825Stheraven__libcpp_fpclassify(_A1 __x) 344227825Stheraven{ 345227825Stheraven return fpclassify(__x); 346227825Stheraven} 347227825Stheraven 348227825Stheraven#undef fpclassify 349227825Stheraven 350227825Stheraventemplate <class _A1> 351227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 352227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, int>::type 353227825Stheravenfpclassify(_A1 __x) 354227825Stheraven{ 355227825Stheraven return __libcpp_fpclassify(__x); 356227825Stheraven} 357227825Stheraven 358227825Stheraven#endif // fpclassify 359227825Stheraven 360227825Stheraven// isfinite 361227825Stheraven 362227825Stheraven#ifdef isfinite 363227825Stheraven 364227825Stheraventemplate <class _A1> 365227825Stheraven_LIBCPP_ALWAYS_INLINE 366227825Stheravenbool 367227825Stheraven__libcpp_isfinite(_A1 __x) 368227825Stheraven{ 369227825Stheraven return isfinite(__x); 370227825Stheraven} 371227825Stheraven 372227825Stheraven#undef isfinite 373227825Stheraven 374227825Stheraventemplate <class _A1> 375227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 376227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 377227825Stheravenisfinite(_A1 __x) 378227825Stheraven{ 379227825Stheraven return __libcpp_isfinite(__x); 380227825Stheraven} 381227825Stheraven 382227825Stheraven#endif // isfinite 383227825Stheraven 384227825Stheraven// isinf 385227825Stheraven 386227825Stheraven#ifdef isinf 387227825Stheraven 388227825Stheraventemplate <class _A1> 389227825Stheraven_LIBCPP_ALWAYS_INLINE 390227825Stheravenbool 391227825Stheraven__libcpp_isinf(_A1 __x) 392227825Stheraven{ 393227825Stheraven return isinf(__x); 394227825Stheraven} 395227825Stheraven 396227825Stheraven#undef isinf 397227825Stheraven 398227825Stheraventemplate <class _A1> 399227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 400227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 401227825Stheravenisinf(_A1 __x) 402227825Stheraven{ 403227825Stheraven return __libcpp_isinf(__x); 404227825Stheraven} 405227825Stheraven 406227825Stheraven#endif // isinf 407227825Stheraven 408227825Stheraven// isnan 409227825Stheraven 410227825Stheraven#ifdef isnan 411227825Stheraven 412227825Stheraventemplate <class _A1> 413227825Stheraven_LIBCPP_ALWAYS_INLINE 414227825Stheravenbool 415227825Stheraven__libcpp_isnan(_A1 __x) 416227825Stheraven{ 417227825Stheraven return isnan(__x); 418227825Stheraven} 419227825Stheraven 420227825Stheraven#undef isnan 421227825Stheraven 422227825Stheraventemplate <class _A1> 423227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 424227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 425227825Stheravenisnan(_A1 __x) 426227825Stheraven{ 427227825Stheraven return __libcpp_isnan(__x); 428227825Stheraven} 429227825Stheraven 430227825Stheraven#endif // isnan 431227825Stheraven 432227825Stheraven// isnormal 433227825Stheraven 434227825Stheraven#ifdef isnormal 435227825Stheraven 436227825Stheraventemplate <class _A1> 437227825Stheraven_LIBCPP_ALWAYS_INLINE 438227825Stheravenbool 439227825Stheraven__libcpp_isnormal(_A1 __x) 440227825Stheraven{ 441227825Stheraven return isnormal(__x); 442227825Stheraven} 443227825Stheraven 444227825Stheraven#undef isnormal 445227825Stheraven 446227825Stheraventemplate <class _A1> 447227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 448227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type 449227825Stheravenisnormal(_A1 __x) 450227825Stheraven{ 451227825Stheraven return __libcpp_isnormal(__x); 452227825Stheraven} 453227825Stheraven 454227825Stheraven#endif // isnormal 455227825Stheraven 456227825Stheraven// isgreater 457227825Stheraven 458227825Stheraven#ifdef isgreater 459227825Stheraven 460227825Stheraventemplate <class _A1, class _A2> 461227825Stheraven_LIBCPP_ALWAYS_INLINE 462227825Stheravenbool 463227825Stheraven__libcpp_isgreater(_A1 __x, _A2 __y) 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< 474227825Stheraven std::is_floating_point<_A1>::value && 475227825Stheraven std::is_floating_point<_A2>::value, 476227825Stheraven bool 477227825Stheraven>::type 478227825Stheravenisgreater(_A1 __x, _A2 __y) 479227825Stheraven{ 480227825Stheraven return __libcpp_isgreater(__x, __y); 481227825Stheraven} 482227825Stheraven 483227825Stheraven#endif // isgreater 484227825Stheraven 485227825Stheraven// isgreaterequal 486227825Stheraven 487227825Stheraven#ifdef isgreaterequal 488227825Stheraven 489227825Stheraventemplate <class _A1, class _A2> 490227825Stheraven_LIBCPP_ALWAYS_INLINE 491227825Stheravenbool 492227825Stheraven__libcpp_isgreaterequal(_A1 __x, _A2 __y) 493227825Stheraven{ 494227825Stheraven return isgreaterequal(__x, __y); 495227825Stheraven} 496227825Stheraven 497227825Stheraven#undef isgreaterequal 498227825Stheraven 499227825Stheraventemplate <class _A1, class _A2> 500227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 501227825Stheraventypename std::enable_if 502227825Stheraven< 503227825Stheraven std::is_floating_point<_A1>::value && 504227825Stheraven std::is_floating_point<_A2>::value, 505227825Stheraven bool 506227825Stheraven>::type 507227825Stheravenisgreaterequal(_A1 __x, _A2 __y) 508227825Stheraven{ 509227825Stheraven return __libcpp_isgreaterequal(__x, __y); 510227825Stheraven} 511227825Stheraven 512227825Stheraven#endif // isgreaterequal 513227825Stheraven 514227825Stheraven// isless 515227825Stheraven 516227825Stheraven#ifdef isless 517227825Stheraven 518227825Stheraventemplate <class _A1, class _A2> 519227825Stheraven_LIBCPP_ALWAYS_INLINE 520227825Stheravenbool 521227825Stheraven__libcpp_isless(_A1 __x, _A2 __y) 522227825Stheraven{ 523227825Stheraven return isless(__x, __y); 524227825Stheraven} 525227825Stheraven 526227825Stheraven#undef isless 527227825Stheraven 528227825Stheraventemplate <class _A1, class _A2> 529227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 530227825Stheraventypename std::enable_if 531227825Stheraven< 532227825Stheraven std::is_floating_point<_A1>::value && 533227825Stheraven std::is_floating_point<_A2>::value, 534227825Stheraven bool 535227825Stheraven>::type 536227825Stheravenisless(_A1 __x, _A2 __y) 537227825Stheraven{ 538227825Stheraven return __libcpp_isless(__x, __y); 539227825Stheraven} 540227825Stheraven 541227825Stheraven#endif // isless 542227825Stheraven 543227825Stheraven// islessequal 544227825Stheraven 545227825Stheraven#ifdef islessequal 546227825Stheraven 547227825Stheraventemplate <class _A1, class _A2> 548227825Stheraven_LIBCPP_ALWAYS_INLINE 549227825Stheravenbool 550227825Stheraven__libcpp_islessequal(_A1 __x, _A2 __y) 551227825Stheraven{ 552227825Stheraven return islessequal(__x, __y); 553227825Stheraven} 554227825Stheraven 555227825Stheraven#undef islessequal 556227825Stheraven 557227825Stheraventemplate <class _A1, class _A2> 558227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 559227825Stheraventypename std::enable_if 560227825Stheraven< 561227825Stheraven std::is_floating_point<_A1>::value && 562227825Stheraven std::is_floating_point<_A2>::value, 563227825Stheraven bool 564227825Stheraven>::type 565227825Stheravenislessequal(_A1 __x, _A2 __y) 566227825Stheraven{ 567227825Stheraven return __libcpp_islessequal(__x, __y); 568227825Stheraven} 569227825Stheraven 570227825Stheraven#endif // islessequal 571227825Stheraven 572227825Stheraven// islessgreater 573227825Stheraven 574227825Stheraven#ifdef islessgreater 575227825Stheraven 576227825Stheraventemplate <class _A1, class _A2> 577227825Stheraven_LIBCPP_ALWAYS_INLINE 578227825Stheravenbool 579227825Stheraven__libcpp_islessgreater(_A1 __x, _A2 __y) 580227825Stheraven{ 581227825Stheraven return islessgreater(__x, __y); 582227825Stheraven} 583227825Stheraven 584227825Stheraven#undef islessgreater 585227825Stheraven 586227825Stheraventemplate <class _A1, class _A2> 587227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 588227825Stheraventypename std::enable_if 589227825Stheraven< 590227825Stheraven std::is_floating_point<_A1>::value && 591227825Stheraven std::is_floating_point<_A2>::value, 592227825Stheraven bool 593227825Stheraven>::type 594227825Stheravenislessgreater(_A1 __x, _A2 __y) 595227825Stheraven{ 596227825Stheraven return __libcpp_islessgreater(__x, __y); 597227825Stheraven} 598227825Stheraven 599227825Stheraven#endif // islessgreater 600227825Stheraven 601227825Stheraven// isunordered 602227825Stheraven 603227825Stheraven#ifdef isunordered 604227825Stheraven 605227825Stheraventemplate <class _A1, class _A2> 606227825Stheraven_LIBCPP_ALWAYS_INLINE 607227825Stheravenbool 608227825Stheraven__libcpp_isunordered(_A1 __x, _A2 __y) 609227825Stheraven{ 610227825Stheraven return isunordered(__x, __y); 611227825Stheraven} 612227825Stheraven 613227825Stheraven#undef isunordered 614227825Stheraven 615227825Stheraventemplate <class _A1, class _A2> 616227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 617227825Stheraventypename std::enable_if 618227825Stheraven< 619227825Stheraven std::is_floating_point<_A1>::value && 620227825Stheraven std::is_floating_point<_A2>::value, 621227825Stheraven bool 622227825Stheraven>::type 623227825Stheravenisunordered(_A1 __x, _A2 __y) 624227825Stheraven{ 625227825Stheraven return __libcpp_isunordered(__x, __y); 626227825Stheraven} 627227825Stheraven 628227825Stheraven#endif // isunordered 629227825Stheraven 630227825Stheraven_LIBCPP_BEGIN_NAMESPACE_STD 631227825Stheraven 632227825Stheravenusing ::signbit; 633227825Stheravenusing ::fpclassify; 634227825Stheravenusing ::isfinite; 635227825Stheravenusing ::isinf; 636227825Stheravenusing ::isnan; 637227825Stheravenusing ::isnormal; 638227825Stheravenusing ::isgreater; 639227825Stheravenusing ::isgreaterequal; 640227825Stheravenusing ::isless; 641227825Stheravenusing ::islessequal; 642227825Stheravenusing ::islessgreater; 643227825Stheravenusing ::isunordered; 644227825Stheravenusing ::isunordered; 645227825Stheraven 646227825Stheravenusing ::float_t; 647227825Stheravenusing ::double_t; 648227825Stheraven 649227825Stheraven// abs 650227825Stheraven 651227825Stheraventemplate <class _A1> 652227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 653227825Stheraventypename enable_if<is_floating_point<_A1>::value, _A1>::type 654227825Stheravenabs(_A1 __x) {return fabs(__x);} 655227825Stheraven 656232950Stheraven#ifndef __sun__ 657232950Stheraven 658227825Stheraven// acos 659227825Stheraven 660227825Stheravenusing ::acos; 661227825Stheravenusing ::acosf; 662227825Stheraven 663227825Stheraven#ifndef _MSC_VER 664227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float acos(float __x) {return acosf(__x);} 665227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) {return acosl(__x);} 666227825Stheraven#endif 667227825Stheraven 668227825Stheraventemplate <class _A1> 669227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 670227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 671227825Stheravenacos(_A1 __x) {return acos((double)__x);} 672227825Stheraven 673227825Stheraven// asin 674227825Stheraven 675227825Stheravenusing ::asin; 676227825Stheravenusing ::asinf; 677227825Stheraven 678227825Stheraven#ifndef _MSC_VER 679227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float asin(float __x) {return asinf(__x);} 680227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) {return asinl(__x);} 681227825Stheraven#endif 682227825Stheraven 683227825Stheraventemplate <class _A1> 684227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 685227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 686227825Stheravenasin(_A1 __x) {return asin((double)__x);} 687227825Stheraven 688227825Stheraven// atan 689227825Stheraven 690227825Stheravenusing ::atan; 691227825Stheravenusing ::atanf; 692227825Stheraven 693227825Stheraven#ifndef _MSC_VER 694227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float atan(float __x) {return atanf(__x);} 695227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) {return atanl(__x);} 696227825Stheraven#endif 697227825Stheraven 698227825Stheraventemplate <class _A1> 699227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 700227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 701227825Stheravenatan(_A1 __x) {return atan((double)__x);} 702227825Stheraven 703227825Stheraven// atan2 704227825Stheraven 705227825Stheravenusing ::atan2; 706227825Stheravenusing ::atan2f; 707227825Stheraven 708227825Stheraven#ifndef _MSC_VER 709227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float atan2(float __y, float __x) {return atan2f(__y, __x);} 710227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) {return atan2l(__y, __x);} 711227825Stheraven#endif 712227825Stheraven 713227825Stheraventemplate <class _A1, class _A2> 714227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 715227825Stheraventypename enable_if 716227825Stheraven< 717227825Stheraven is_arithmetic<_A1>::value && 718227825Stheraven is_arithmetic<_A2>::value, 719227825Stheraven typename __promote<_A1, _A2>::type 720227825Stheraven>::type 721227825Stheravenatan2(_A1 __y, _A2 __x) 722227825Stheraven{ 723227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 724227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 725227825Stheraven is_same<_A2, __result_type>::value)), ""); 726227825Stheraven return atan2((__result_type)__y, (__result_type)__x); 727227825Stheraven} 728227825Stheraven 729227825Stheraven// ceil 730227825Stheraven 731227825Stheravenusing ::ceil; 732227825Stheravenusing ::ceilf; 733227825Stheraven 734227825Stheraven#ifndef _MSC_VER 735227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float ceil(float __x) {return ceilf(__x);} 736227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) {return ceill(__x);} 737227825Stheraven#endif 738227825Stheraven 739227825Stheraventemplate <class _A1> 740227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 741227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 742227825Stheravenceil(_A1 __x) {return ceil((double)__x);} 743227825Stheraven 744227825Stheraven// cos 745227825Stheraven 746227825Stheravenusing ::cos; 747227825Stheravenusing ::cosf; 748227825Stheraven 749227825Stheraven#ifndef _MSC_VER 750227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float cos(float __x) {return cosf(__x);} 751227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) {return cosl(__x);} 752227825Stheraven#endif 753227825Stheraven 754227825Stheraventemplate <class _A1> 755227825Stheraveninline _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY 756227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 757227825Stheravencos(_A1 __x) {return cos((double)__x);} 758227825Stheraven 759227825Stheraven// cosh 760227825Stheraven 761227825Stheravenusing ::cosh; 762227825Stheravenusing ::coshf; 763227825Stheraven 764227825Stheraven#ifndef _MSC_VER 765227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float cosh(float __x) {return coshf(__x);} 766227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) {return coshl(__x);} 767227825Stheraven#endif 768227825Stheraven 769227825Stheraventemplate <class _A1> 770227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 771227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 772227825Stheravencosh(_A1 __x) {return cosh((double)__x);} 773227825Stheraven 774232950Stheraven#endif // __sun__ 775227825Stheraven// exp 776227825Stheraven 777227825Stheravenusing ::exp; 778227825Stheravenusing ::expf; 779227825Stheraven 780232950Stheraven#ifndef __sun__ 781232950Stheraven 782227825Stheraven#ifndef _MSC_VER 783227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float exp(float __x) {return expf(__x);} 784227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) {return expl(__x);} 785227825Stheraven#endif 786227825Stheraven 787232950Stheraven 788227825Stheraventemplate <class _A1> 789227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 790227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 791227825Stheravenexp(_A1 __x) {return exp((double)__x);} 792227825Stheraven 793227825Stheraven// fabs 794227825Stheraven 795227825Stheravenusing ::fabs; 796227825Stheravenusing ::fabsf; 797227825Stheraven 798227825Stheraven#ifndef _MSC_VER 799227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fabs(float __x) {return fabsf(__x);} 800227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) {return fabsl(__x);} 801227825Stheraven#endif 802227825Stheraven 803227825Stheraventemplate <class _A1> 804227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 805227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 806227825Stheravenfabs(_A1 __x) {return fabs((double)__x);} 807227825Stheraven 808227825Stheraven// floor 809227825Stheraven 810227825Stheravenusing ::floor; 811227825Stheravenusing ::floorf; 812227825Stheraven 813227825Stheraven#ifndef _MSC_VER 814227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float floor(float __x) {return floorf(__x);} 815227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) {return floorl(__x);} 816227825Stheraven#endif 817227825Stheraven 818227825Stheraventemplate <class _A1> 819227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 820227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 821227825Stheravenfloor(_A1 __x) {return floor((double)__x);} 822227825Stheraven 823227825Stheraven// fmod 824227825Stheraven 825232950Stheraven#endif //__sun__ 826227825Stheravenusing ::fmod; 827227825Stheravenusing ::fmodf; 828232950Stheraven#ifndef __sun__ 829227825Stheraven 830227825Stheraven#ifndef _MSC_VER 831227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fmod(float __x, float __y) {return fmodf(__x, __y);} 832227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) {return fmodl(__x, __y);} 833227825Stheraven#endif 834227825Stheraven 835227825Stheraventemplate <class _A1, class _A2> 836227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 837227825Stheraventypename enable_if 838227825Stheraven< 839227825Stheraven is_arithmetic<_A1>::value && 840227825Stheraven is_arithmetic<_A2>::value, 841227825Stheraven typename __promote<_A1, _A2>::type 842227825Stheraven>::type 843227825Stheravenfmod(_A1 __x, _A2 __y) 844227825Stheraven{ 845227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 846227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 847227825Stheraven is_same<_A2, __result_type>::value)), ""); 848227825Stheraven return fmod((__result_type)__x, (__result_type)__y); 849227825Stheraven} 850227825Stheraven 851232950Stheraven 852227825Stheraven// frexp 853227825Stheraven 854227825Stheravenusing ::frexp; 855227825Stheravenusing ::frexpf; 856227825Stheraven 857227825Stheraven#ifndef _MSC_VER 858227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float frexp(float __x, int* __e) {return frexpf(__x, __e);} 859227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) {return frexpl(__x, __e);} 860227825Stheraven#endif 861227825Stheraven 862227825Stheraventemplate <class _A1> 863227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 864227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 865227825Stheravenfrexp(_A1 __x, int* __e) {return frexp((double)__x, __e);} 866227825Stheraven 867227825Stheraven// ldexp 868227825Stheraven 869227825Stheravenusing ::ldexp; 870227825Stheravenusing ::ldexpf; 871227825Stheraven 872227825Stheraven#ifndef _MSC_VER 873227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float ldexp(float __x, int __e) {return ldexpf(__x, __e);} 874227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) {return ldexpl(__x, __e);} 875227825Stheraven#endif 876227825Stheraven 877227825Stheraventemplate <class _A1> 878227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 879227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 880227825Stheravenldexp(_A1 __x, int __e) {return ldexp((double)__x, __e);} 881227825Stheraven 882227825Stheraven// log 883227825Stheraven 884232950Stheraven#endif // __sun__ 885227825Stheravenusing ::log; 886227825Stheravenusing ::logf; 887232950Stheraven#ifndef __sun__ 888227825Stheraven 889227825Stheraven#ifndef _MSC_VER 890227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float log(float __x) {return logf(__x);} 891227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) {return logl(__x);} 892227825Stheraven#endif 893227825Stheraven 894227825Stheraventemplate <class _A1> 895227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 896227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 897227825Stheravenlog(_A1 __x) {return log((double)__x);} 898227825Stheraven 899232950Stheraven 900227825Stheraven// log10 901227825Stheraven 902227825Stheravenusing ::log10; 903227825Stheravenusing ::log10f; 904227825Stheraven 905227825Stheraven#ifndef _MSC_VER 906227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float log10(float __x) {return log10f(__x);} 907227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) {return log10l(__x);} 908227825Stheraven#endif 909227825Stheraven 910227825Stheraventemplate <class _A1> 911227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 912227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 913227825Stheravenlog10(_A1 __x) {return log10((double)__x);} 914227825Stheraven 915227825Stheraven// modf 916227825Stheraven 917227825Stheravenusing ::modf; 918227825Stheravenusing ::modff; 919227825Stheraven 920227825Stheraven#ifndef _MSC_VER 921227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float modf(float __x, float* __y) {return modff(__x, __y);} 922227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) {return modfl(__x, __y);} 923227825Stheraven#endif 924227825Stheraven 925227825Stheraven// pow 926227825Stheraven 927232950Stheraven#endif // __sun__ 928227825Stheravenusing ::pow; 929227825Stheravenusing ::powf; 930227825Stheraven 931232950Stheraven#ifndef __sun__ 932232950Stheraven 933227825Stheraven#ifndef _MSC_VER 934227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float pow(float __x, float __y) {return powf(__x, __y);} 935227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) {return powl(__x, __y);} 936227825Stheraven#endif 937227825Stheraven 938227825Stheraventemplate <class _A1, class _A2> 939227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 940227825Stheraventypename enable_if 941227825Stheraven< 942227825Stheraven is_arithmetic<_A1>::value && 943227825Stheraven is_arithmetic<_A2>::value, 944227825Stheraven typename __promote<_A1, _A2>::type 945227825Stheraven>::type 946227825Stheravenpow(_A1 __x, _A2 __y) 947227825Stheraven{ 948227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 949227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 950227825Stheraven is_same<_A2, __result_type>::value)), ""); 951227825Stheraven return pow((__result_type)__x, (__result_type)__y); 952227825Stheraven} 953227825Stheraven 954232950Stheraven 955227825Stheraven// sin 956227825Stheraven 957227825Stheravenusing ::sin; 958227825Stheravenusing ::sinf; 959227825Stheraven 960227825Stheraven#ifndef _MSC_VER 961227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float sin(float __x) {return sinf(__x);} 962227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) {return sinl(__x);} 963227825Stheraven#endif 964227825Stheraven 965227825Stheraventemplate <class _A1> 966227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 967227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 968227825Stheravensin(_A1 __x) {return sin((double)__x);} 969227825Stheraven 970227825Stheraven// sinh 971227825Stheraven 972227825Stheravenusing ::sinh; 973227825Stheravenusing ::sinhf; 974227825Stheraven 975227825Stheraven#ifndef _MSC_VER 976227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float sinh(float __x) {return sinhf(__x);} 977227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) {return sinhl(__x);} 978227825Stheraven#endif 979227825Stheraven 980227825Stheraventemplate <class _A1> 981227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 982227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 983227825Stheravensinh(_A1 __x) {return sinh((double)__x);} 984227825Stheraven 985227825Stheraven// sqrt 986227825Stheraven 987232950Stheraven#endif // __sun__ 988227825Stheravenusing ::sqrt; 989227825Stheravenusing ::sqrtf; 990227825Stheraven 991232950Stheraven 992232950Stheraven#if !(defined(_MSC_VER) || defined(__sun__)) 993227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float sqrt(float __x) {return sqrtf(__x);} 994227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) {return sqrtl(__x);} 995227825Stheraven#endif 996227825Stheraven 997227825Stheraventemplate <class _A1> 998227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 999227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1000227825Stheravensqrt(_A1 __x) {return sqrt((double)__x);} 1001227825Stheraven 1002227825Stheraven// tan 1003227825Stheraven 1004227825Stheravenusing ::tan; 1005227825Stheravenusing ::tanf; 1006232950Stheraven#ifndef __sun__ 1007227825Stheraven 1008227825Stheraven#ifndef _MSC_VER 1009227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float tan(float __x) {return tanf(__x);} 1010227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) {return tanl(__x);} 1011227825Stheraven#endif 1012227825Stheraven 1013227825Stheraventemplate <class _A1> 1014227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1015227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1016227825Stheraventan(_A1 __x) {return tan((double)__x);} 1017227825Stheraven 1018227825Stheraven// tanh 1019227825Stheraven 1020227825Stheravenusing ::tanh; 1021227825Stheravenusing ::tanhf; 1022227825Stheraven 1023227825Stheraven#ifndef _MSC_VER 1024227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float tanh(float __x) {return tanhf(__x);} 1025227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) {return tanhl(__x);} 1026227825Stheraven#endif 1027227825Stheraven 1028227825Stheraventemplate <class _A1> 1029227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1030227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1031227825Stheraventanh(_A1 __x) {return tanh((double)__x);} 1032227825Stheraven 1033227825Stheraven// acosh 1034227825Stheraven 1035227825Stheraven#ifndef _MSC_VER 1036227825Stheravenusing ::acosh; 1037227825Stheravenusing ::acoshf; 1038227825Stheraven 1039227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float acosh(float __x) {return acoshf(__x);} 1040227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) {return acoshl(__x);} 1041227825Stheraven 1042227825Stheraventemplate <class _A1> 1043227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1044227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1045227825Stheravenacosh(_A1 __x) {return acosh((double)__x);} 1046227825Stheraven#endif 1047227825Stheraven 1048227825Stheraven// asinh 1049227825Stheraven 1050227825Stheraven#ifndef _MSC_VER 1051227825Stheravenusing ::asinh; 1052227825Stheravenusing ::asinhf; 1053227825Stheraven 1054227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float asinh(float __x) {return asinhf(__x);} 1055227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) {return asinhl(__x);} 1056227825Stheraven 1057227825Stheraventemplate <class _A1> 1058227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1059227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1060227825Stheravenasinh(_A1 __x) {return asinh((double)__x);} 1061227825Stheraven#endif 1062227825Stheraven 1063227825Stheraven// atanh 1064227825Stheraven 1065227825Stheraven#ifndef _MSC_VER 1066227825Stheravenusing ::atanh; 1067227825Stheravenusing ::atanhf; 1068227825Stheraven 1069227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float atanh(float __x) {return atanhf(__x);} 1070227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) {return atanhl(__x);} 1071227825Stheraven 1072227825Stheraventemplate <class _A1> 1073227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1074227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1075227825Stheravenatanh(_A1 __x) {return atanh((double)__x);} 1076227825Stheraven#endif 1077227825Stheraven 1078227825Stheraven// cbrt 1079227825Stheraven 1080227825Stheraven#ifndef _MSC_VER 1081227825Stheravenusing ::cbrt; 1082227825Stheravenusing ::cbrtf; 1083227825Stheraven 1084227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float cbrt(float __x) {return cbrtf(__x);} 1085227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) {return cbrtl(__x);} 1086227825Stheraven 1087227825Stheraventemplate <class _A1> 1088227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1089227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1090227825Stheravencbrt(_A1 __x) {return cbrt((double)__x);} 1091227825Stheraven#endif 1092227825Stheraven 1093227825Stheraven// copysign 1094227825Stheraven 1095227825Stheravenusing ::copysign; 1096227825Stheravenusing ::copysignf; 1097227825Stheraven 1098227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float copysign(float __x, float __y) {return copysignf(__x, __y);} 1099227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) {return copysignl(__x, __y);} 1100227825Stheraven 1101227825Stheraventemplate <class _A1, class _A2> 1102227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1103227825Stheraventypename enable_if 1104227825Stheraven< 1105227825Stheraven is_arithmetic<_A1>::value && 1106227825Stheraven is_arithmetic<_A2>::value, 1107227825Stheraven typename __promote<_A1, _A2>::type 1108227825Stheraven>::type 1109227825Stheravencopysign(_A1 __x, _A2 __y) 1110227825Stheraven{ 1111227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1112227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1113227825Stheraven is_same<_A2, __result_type>::value)), ""); 1114227825Stheraven return copysign((__result_type)__x, (__result_type)__y); 1115227825Stheraven} 1116227825Stheraven 1117227825Stheraven#ifndef _MSC_VER 1118227825Stheraven 1119227825Stheraven// erf 1120227825Stheraven 1121227825Stheravenusing ::erf; 1122227825Stheravenusing ::erff; 1123227825Stheraven 1124227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float erf(float __x) {return erff(__x);} 1125227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) {return erfl(__x);} 1126227825Stheraven 1127227825Stheraventemplate <class _A1> 1128227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1129227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1130227825Stheravenerf(_A1 __x) {return erf((double)__x);} 1131227825Stheraven 1132227825Stheraven// erfc 1133227825Stheraven 1134227825Stheravenusing ::erfc; 1135227825Stheravenusing ::erfcf; 1136227825Stheraven 1137227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float erfc(float __x) {return erfcf(__x);} 1138227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) {return erfcl(__x);} 1139227825Stheraven 1140227825Stheraventemplate <class _A1> 1141227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1142227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1143227825Stheravenerfc(_A1 __x) {return erfc((double)__x);} 1144227825Stheraven 1145227825Stheraven// exp2 1146227825Stheraven 1147227825Stheravenusing ::exp2; 1148227825Stheravenusing ::exp2f; 1149227825Stheraven 1150227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float exp2(float __x) {return exp2f(__x);} 1151227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) {return exp2l(__x);} 1152227825Stheraven 1153227825Stheraventemplate <class _A1> 1154227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1155227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1156227825Stheravenexp2(_A1 __x) {return exp2((double)__x);} 1157227825Stheraven 1158227825Stheraven// expm1 1159227825Stheraven 1160227825Stheravenusing ::expm1; 1161227825Stheravenusing ::expm1f; 1162227825Stheraven 1163227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float expm1(float __x) {return expm1f(__x);} 1164227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) {return expm1l(__x);} 1165227825Stheraven 1166227825Stheraventemplate <class _A1> 1167227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1168227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1169227825Stheravenexpm1(_A1 __x) {return expm1((double)__x);} 1170227825Stheraven 1171227825Stheraven// fdim 1172227825Stheraven 1173227825Stheravenusing ::fdim; 1174227825Stheravenusing ::fdimf; 1175227825Stheraven 1176227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fdim(float __x, float __y) {return fdimf(__x, __y);} 1177227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) {return fdiml(__x, __y);} 1178227825Stheraven 1179227825Stheraventemplate <class _A1, class _A2> 1180227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1181227825Stheraventypename enable_if 1182227825Stheraven< 1183227825Stheraven is_arithmetic<_A1>::value && 1184227825Stheraven is_arithmetic<_A2>::value, 1185227825Stheraven typename __promote<_A1, _A2>::type 1186227825Stheraven>::type 1187227825Stheravenfdim(_A1 __x, _A2 __y) 1188227825Stheraven{ 1189227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1190227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1191227825Stheraven is_same<_A2, __result_type>::value)), ""); 1192227825Stheraven return fdim((__result_type)__x, (__result_type)__y); 1193227825Stheraven} 1194227825Stheraven 1195227825Stheraven// fma 1196227825Stheraven 1197227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) {return (float)((double)__x*__y + __z);} 1198227825Stheraven#define FP_FAST_FMAF 1199227825Stheraven 1200227825Stheravenusing ::fma; 1201227825Stheraven 1202227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) {return fmaf(__x, __y, __z);} 1203227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) {return fmal(__x, __y, __z);} 1204227825Stheraven 1205227825Stheraventemplate <class _A1, class _A2, class _A3> 1206227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1207227825Stheraventypename enable_if 1208227825Stheraven< 1209227825Stheraven is_arithmetic<_A1>::value && 1210227825Stheraven is_arithmetic<_A2>::value && 1211227825Stheraven is_arithmetic<_A3>::value, 1212227825Stheraven typename __promote<_A1, _A2, _A3>::type 1213227825Stheraven>::type 1214227825Stheravenfma(_A1 __x, _A2 __y, _A3 __z) 1215227825Stheraven{ 1216227825Stheraven typedef typename __promote<_A1, _A2, _A3>::type __result_type; 1217227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1218227825Stheraven is_same<_A2, __result_type>::value && 1219227825Stheraven is_same<_A3, __result_type>::value)), ""); 1220227825Stheraven return fma((__result_type)__x, (__result_type)__y, (__result_type)__z); 1221227825Stheraven} 1222227825Stheraven 1223227825Stheraven// fmax 1224227825Stheraven 1225227825Stheravenusing ::fmax; 1226227825Stheravenusing ::fmaxf; 1227227825Stheraven 1228227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fmax(float __x, float __y) {return fmaxf(__x, __y);} 1229227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) {return fmaxl(__x, __y);} 1230227825Stheraven 1231227825Stheraventemplate <class _A1, class _A2> 1232227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1233227825Stheraventypename enable_if 1234227825Stheraven< 1235227825Stheraven is_arithmetic<_A1>::value && 1236227825Stheraven is_arithmetic<_A2>::value, 1237227825Stheraven typename __promote<_A1, _A2>::type 1238227825Stheraven>::type 1239227825Stheravenfmax(_A1 __x, _A2 __y) 1240227825Stheraven{ 1241227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1242227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1243227825Stheraven is_same<_A2, __result_type>::value)), ""); 1244227825Stheraven return fmax((__result_type)__x, (__result_type)__y); 1245227825Stheraven} 1246227825Stheraven 1247227825Stheraven// fmin 1248227825Stheraven 1249227825Stheravenusing ::fmin; 1250227825Stheravenusing ::fminf; 1251227825Stheraven 1252227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fmin(float __x, float __y) {return fminf(__x, __y);} 1253227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) {return fminl(__x, __y);} 1254227825Stheraven 1255227825Stheraventemplate <class _A1, class _A2> 1256227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1257227825Stheraventypename enable_if 1258227825Stheraven< 1259227825Stheraven is_arithmetic<_A1>::value && 1260227825Stheraven is_arithmetic<_A2>::value, 1261227825Stheraven typename __promote<_A1, _A2>::type 1262227825Stheraven>::type 1263227825Stheravenfmin(_A1 __x, _A2 __y) 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)), ""); 1268227825Stheraven return fmin((__result_type)__x, (__result_type)__y); 1269227825Stheraven} 1270227825Stheraven 1271227825Stheraven// hypot 1272227825Stheraven 1273227825Stheravenusing ::hypot; 1274227825Stheravenusing ::hypotf; 1275227825Stheraven 1276227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float hypot(float __x, float __y) {return hypotf(__x, __y);} 1277227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) {return hypotl(__x, __y);} 1278227825Stheraven 1279227825Stheraventemplate <class _A1, class _A2> 1280227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1281227825Stheraventypename enable_if 1282227825Stheraven< 1283227825Stheraven is_arithmetic<_A1>::value && 1284227825Stheraven is_arithmetic<_A2>::value, 1285227825Stheraven typename __promote<_A1, _A2>::type 1286227825Stheraven>::type 1287227825Stheravenhypot(_A1 __x, _A2 __y) 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)), ""); 1292227825Stheraven return hypot((__result_type)__x, (__result_type)__y); 1293227825Stheraven} 1294227825Stheraven 1295227825Stheraven// ilogb 1296227825Stheraven 1297227825Stheravenusing ::ilogb; 1298227825Stheravenusing ::ilogbf; 1299227825Stheraven 1300227825Stheraveninline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x) {return ilogbf(__x);} 1301227825Stheraveninline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) {return ilogbl(__x);} 1302227825Stheraven 1303227825Stheraventemplate <class _A1> 1304227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1305227825Stheraventypename enable_if<is_integral<_A1>::value, int>::type 1306227825Stheravenilogb(_A1 __x) {return ilogb((double)__x);} 1307227825Stheraven 1308227825Stheraven// lgamma 1309227825Stheraven 1310227825Stheravenusing ::lgamma; 1311227825Stheravenusing ::lgammaf; 1312227825Stheraven 1313227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float lgamma(float __x) {return lgammaf(__x);} 1314227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) {return lgammal(__x);} 1315227825Stheraven 1316232950Stheraven 1317227825Stheraventemplate <class _A1> 1318227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1319227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1320227825Stheravenlgamma(_A1 __x) {return lgamma((double)__x);} 1321227825Stheraven 1322232950Stheraven 1323227825Stheraven// llrint 1324227825Stheraven 1325227825Stheravenusing ::llrint; 1326227825Stheravenusing ::llrintf; 1327227825Stheraven 1328227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) {return llrintf(__x);} 1329227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) {return llrintl(__x);} 1330227825Stheraven 1331227825Stheraventemplate <class _A1> 1332227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1333227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type 1334227825Stheravenllrint(_A1 __x) {return llrint((double)__x);} 1335227825Stheraven 1336227825Stheraven// llround 1337227825Stheraven 1338227825Stheravenusing ::llround; 1339227825Stheravenusing ::llroundf; 1340227825Stheraven 1341227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) {return llroundf(__x);} 1342227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) {return llroundl(__x);} 1343227825Stheraven 1344227825Stheraventemplate <class _A1> 1345227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1346227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type 1347227825Stheravenllround(_A1 __x) {return llround((double)__x);} 1348227825Stheraven 1349227825Stheraven// log1p 1350227825Stheraven 1351227825Stheravenusing ::log1p; 1352227825Stheravenusing ::log1pf; 1353227825Stheraven 1354227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float log1p(float __x) {return log1pf(__x);} 1355227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) {return log1pl(__x);} 1356227825Stheraven 1357227825Stheraventemplate <class _A1> 1358227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1359227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1360227825Stheravenlog1p(_A1 __x) {return log1p((double)__x);} 1361227825Stheraven 1362227825Stheraven// log2 1363227825Stheraven 1364227825Stheravenusing ::log2; 1365227825Stheravenusing ::log2f; 1366227825Stheraven 1367227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float log2(float __x) {return log2f(__x);} 1368227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) {return log2l(__x);} 1369227825Stheraven 1370227825Stheraventemplate <class _A1> 1371227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1372227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1373227825Stheravenlog2(_A1 __x) {return log2((double)__x);} 1374227825Stheraven 1375227825Stheraven// logb 1376227825Stheraven 1377227825Stheravenusing ::logb; 1378227825Stheravenusing ::logbf; 1379227825Stheraven 1380227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float logb(float __x) {return logbf(__x);} 1381227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) {return logbl(__x);} 1382227825Stheraven 1383227825Stheraventemplate <class _A1> 1384227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1385227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1386227825Stheravenlogb(_A1 __x) {return logb((double)__x);} 1387227825Stheraven 1388227825Stheraven// lrint 1389227825Stheraven 1390227825Stheravenusing ::lrint; 1391227825Stheravenusing ::lrintf; 1392227825Stheraven 1393227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lrint(float __x) {return lrintf(__x);} 1394227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) {return lrintl(__x);} 1395227825Stheraven 1396227825Stheraventemplate <class _A1> 1397227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1398227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type 1399227825Stheravenlrint(_A1 __x) {return lrint((double)__x);} 1400227825Stheraven 1401227825Stheraven// lround 1402227825Stheraven 1403227825Stheravenusing ::lround; 1404227825Stheravenusing ::lroundf; 1405227825Stheraven 1406227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lround(float __x) {return lroundf(__x);} 1407227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) {return lroundl(__x);} 1408227825Stheraven 1409227825Stheraventemplate <class _A1> 1410227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1411227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type 1412227825Stheravenlround(_A1 __x) {return lround((double)__x);} 1413227825Stheraven 1414227825Stheraven// nan 1415232950Stheraven#endif // _MSC_VER 1416232950Stheraven#endif // __sun__ 1417227825Stheravenusing ::nan; 1418227825Stheravenusing ::nanf; 1419232950Stheraven#ifndef __sun__ 1420232950Stheraven#ifndef _MSC_VER 1421227825Stheraven 1422227825Stheraven// nearbyint 1423227825Stheraven 1424227825Stheravenusing ::nearbyint; 1425227825Stheravenusing ::nearbyintf; 1426227825Stheraven 1427227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __x) {return nearbyintf(__x);} 1428227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) {return nearbyintl(__x);} 1429227825Stheraven 1430227825Stheraventemplate <class _A1> 1431227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1432227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1433227825Stheravennearbyint(_A1 __x) {return nearbyint((double)__x);} 1434227825Stheraven 1435227825Stheraven// nextafter 1436227825Stheraven 1437227825Stheravenusing ::nextafter; 1438227825Stheravenusing ::nextafterf; 1439227825Stheraven 1440227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float nextafter(float __x, float __y) {return nextafterf(__x, __y);} 1441227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) {return nextafterl(__x, __y);} 1442227825Stheraven 1443227825Stheraventemplate <class _A1, class _A2> 1444227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1445227825Stheraventypename enable_if 1446227825Stheraven< 1447227825Stheraven is_arithmetic<_A1>::value && 1448227825Stheraven is_arithmetic<_A2>::value, 1449227825Stheraven typename __promote<_A1, _A2>::type 1450227825Stheraven>::type 1451227825Stheravennextafter(_A1 __x, _A2 __y) 1452227825Stheraven{ 1453227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1454227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1455227825Stheraven is_same<_A2, __result_type>::value)), ""); 1456227825Stheraven return nextafter((__result_type)__x, (__result_type)__y); 1457227825Stheraven} 1458227825Stheraven 1459227825Stheraven// nexttoward 1460227825Stheraven 1461227825Stheravenusing ::nexttoward; 1462227825Stheravenusing ::nexttowardf; 1463227825Stheraven 1464227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __x, long double __y) {return nexttowardf(__x, __y);} 1465227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);} 1466227825Stheraven 1467227825Stheraventemplate <class _A1> 1468227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1469227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1470227825Stheravennexttoward(_A1 __x, long double __y) {return nexttoward((double)__x, __y);} 1471227825Stheraven 1472227825Stheraven// remainder 1473227825Stheraven 1474227825Stheravenusing ::remainder; 1475227825Stheravenusing ::remainderf; 1476227825Stheraven 1477227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float remainder(float __x, float __y) {return remainderf(__x, __y);} 1478227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) {return remainderl(__x, __y);} 1479227825Stheraven 1480227825Stheraventemplate <class _A1, class _A2> 1481227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1482227825Stheraventypename enable_if 1483227825Stheraven< 1484227825Stheraven is_arithmetic<_A1>::value && 1485227825Stheraven is_arithmetic<_A2>::value, 1486227825Stheraven typename __promote<_A1, _A2>::type 1487227825Stheraven>::type 1488227825Stheravenremainder(_A1 __x, _A2 __y) 1489227825Stheraven{ 1490227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1491227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1492227825Stheraven is_same<_A2, __result_type>::value)), ""); 1493227825Stheraven return remainder((__result_type)__x, (__result_type)__y); 1494227825Stheraven} 1495227825Stheraven 1496227825Stheraven// remquo 1497227825Stheraven 1498227825Stheravenusing ::remquo; 1499227825Stheravenusing ::remquof; 1500227825Stheraven 1501227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float remquo(float __x, float __y, int* __z) {return remquof(__x, __y, __z);} 1502227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) {return remquol(__x, __y, __z);} 1503227825Stheraven 1504227825Stheraventemplate <class _A1, class _A2> 1505227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1506227825Stheraventypename enable_if 1507227825Stheraven< 1508227825Stheraven is_arithmetic<_A1>::value && 1509227825Stheraven is_arithmetic<_A2>::value, 1510227825Stheraven typename __promote<_A1, _A2>::type 1511227825Stheraven>::type 1512227825Stheravenremquo(_A1 __x, _A2 __y, int* __z) 1513227825Stheraven{ 1514227825Stheraven typedef typename __promote<_A1, _A2>::type __result_type; 1515227825Stheraven static_assert((!(is_same<_A1, __result_type>::value && 1516227825Stheraven is_same<_A2, __result_type>::value)), ""); 1517227825Stheraven return remquo((__result_type)__x, (__result_type)__y, __z); 1518227825Stheraven} 1519227825Stheraven 1520227825Stheraven// rint 1521227825Stheraven 1522227825Stheravenusing ::rint; 1523227825Stheravenusing ::rintf; 1524227825Stheraven 1525227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float rint(float __x) {return rintf(__x);} 1526227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) {return rintl(__x);} 1527227825Stheraven 1528227825Stheraventemplate <class _A1> 1529227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1530227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1531227825Stheravenrint(_A1 __x) {return rint((double)__x);} 1532227825Stheraven 1533227825Stheraven// round 1534227825Stheraven 1535227825Stheravenusing ::round; 1536227825Stheravenusing ::roundf; 1537227825Stheraven 1538227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float round(float __x) {return roundf(__x);} 1539227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) {return roundl(__x);} 1540227825Stheraven 1541227825Stheraventemplate <class _A1> 1542227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1543227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1544227825Stheravenround(_A1 __x) {return round((double)__x);} 1545227825Stheraven 1546227825Stheraven// scalbln 1547227825Stheraven 1548227825Stheravenusing ::scalbln; 1549227825Stheravenusing ::scalblnf; 1550227825Stheraven 1551227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float scalbln(float __x, long __y) {return scalblnf(__x, __y);} 1552227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) {return scalblnl(__x, __y);} 1553227825Stheraven 1554227825Stheraventemplate <class _A1> 1555227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1556227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1557227825Stheravenscalbln(_A1 __x, long __y) {return scalbln((double)__x, __y);} 1558227825Stheraven 1559227825Stheraven// scalbn 1560227825Stheraven 1561227825Stheravenusing ::scalbn; 1562227825Stheravenusing ::scalbnf; 1563227825Stheraven 1564227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) {return scalbnf(__x, __y);} 1565227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) {return scalbnl(__x, __y);} 1566227825Stheraven 1567227825Stheraventemplate <class _A1> 1568227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1569227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1570227825Stheravenscalbn(_A1 __x, int __y) {return scalbn((double)__x, __y);} 1571227825Stheraven 1572227825Stheraven// tgamma 1573227825Stheraven 1574227825Stheravenusing ::tgamma; 1575227825Stheravenusing ::tgammaf; 1576227825Stheraven 1577227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float tgamma(float __x) {return tgammaf(__x);} 1578227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) {return tgammal(__x);} 1579227825Stheraven 1580227825Stheraventemplate <class _A1> 1581227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1582227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1583227825Stheraventgamma(_A1 __x) {return tgamma((double)__x);} 1584227825Stheraven 1585227825Stheraven// trunc 1586227825Stheraven 1587227825Stheravenusing ::trunc; 1588227825Stheravenusing ::truncf; 1589227825Stheraven 1590227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float trunc(float __x) {return truncf(__x);} 1591227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) {return truncl(__x);} 1592227825Stheraven 1593227825Stheraventemplate <class _A1> 1594227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1595227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type 1596227825Stheraventrunc(_A1 __x) {return trunc((double)__x);} 1597227825Stheraven 1598227825Stheraven#endif // !_MSC_VER 1599227825Stheraven 1600227825Stheravenusing ::acosl; 1601227825Stheravenusing ::asinl; 1602227825Stheravenusing ::atanl; 1603227825Stheravenusing ::atan2l; 1604227825Stheravenusing ::ceill; 1605227825Stheravenusing ::cosl; 1606227825Stheravenusing ::coshl; 1607227825Stheravenusing ::expl; 1608227825Stheravenusing ::fabsl; 1609227825Stheravenusing ::floorl; 1610227825Stheravenusing ::fmodl; 1611227825Stheravenusing ::frexpl; 1612227825Stheravenusing ::ldexpl; 1613227825Stheravenusing ::logl; 1614227825Stheravenusing ::log10l; 1615227825Stheravenusing ::modfl; 1616227825Stheravenusing ::powl; 1617227825Stheravenusing ::sinl; 1618227825Stheravenusing ::sinhl; 1619227825Stheravenusing ::sqrtl; 1620227825Stheravenusing ::tanl; 1621227825Stheraven#ifndef _MSC_VER 1622227825Stheravenusing ::tanhl; 1623227825Stheravenusing ::acoshl; 1624227825Stheravenusing ::asinhl; 1625227825Stheravenusing ::atanhl; 1626227825Stheravenusing ::cbrtl; 1627232950Stheraven#endif // !_MSC_VER 1628227825Stheravenusing ::copysignl; 1629227825Stheraven#ifndef _MSC_VER 1630227825Stheravenusing ::erfl; 1631227825Stheravenusing ::erfcl; 1632227825Stheravenusing ::exp2l; 1633227825Stheravenusing ::expm1l; 1634227825Stheravenusing ::fdiml; 1635227825Stheravenusing ::fmal; 1636227825Stheravenusing ::fmaxl; 1637227825Stheravenusing ::fminl; 1638227825Stheravenusing ::hypotl; 1639227825Stheravenusing ::ilogbl; 1640227825Stheravenusing ::lgammal; 1641227825Stheravenusing ::llrintl; 1642227825Stheravenusing ::llroundl; 1643227825Stheravenusing ::log1pl; 1644227825Stheravenusing ::log2l; 1645227825Stheravenusing ::logbl; 1646227825Stheravenusing ::lrintl; 1647227825Stheravenusing ::lroundl; 1648227825Stheravenusing ::nanl; 1649227825Stheravenusing ::nearbyintl; 1650227825Stheravenusing ::nextafterl; 1651227825Stheravenusing ::nexttowardl; 1652227825Stheravenusing ::remainderl; 1653227825Stheravenusing ::remquol; 1654227825Stheravenusing ::rintl; 1655227825Stheravenusing ::roundl; 1656227825Stheravenusing ::scalblnl; 1657227825Stheravenusing ::scalbnl; 1658227825Stheravenusing ::tgammal; 1659227825Stheravenusing ::truncl; 1660227825Stheraven#endif // !_MSC_VER 1661227825Stheraven 1662232950Stheraven#else 1663232950Stheravenusing ::lgamma; 1664232950Stheravenusing ::lgammaf; 1665232950Stheraven#endif // __sun__ 1666227825Stheraven_LIBCPP_END_NAMESPACE_STD 1667227825Stheraven 1668227825Stheraven#endif // _LIBCPP_CMATH 1669