11 #ifndef _LIBCPP_MATH_H
12 #define _LIBCPP_MATH_H
297 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
298 #pragma GCC system_header
301 #include_next <math.h>
309 #include <type_traits>
317 _LIBCPP_INLINE_VISIBILITY
319 __libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
321 return signbit(__lcpp_x);
327 inline _LIBCPP_INLINE_VISIBILITY
328 typename std::enable_if<std::is_floating_point<_A1>::value,
bool>::type
329 signbit(_A1 __lcpp_x) _NOEXCEPT
331 return __libcpp_signbit((
typename std::__promote<_A1>::type)__lcpp_x);
335 inline _LIBCPP_INLINE_VISIBILITY
336 typename std::enable_if<
337 std::is_integral<_A1>::value && std::is_signed<_A1>::value,
bool>::type
338 signbit(_A1 __lcpp_x) _NOEXCEPT
339 {
return __lcpp_x < 0; }
342 inline _LIBCPP_INLINE_VISIBILITY
343 typename std::enable_if<
344 std::is_integral<_A1>::value && !std::is_signed<_A1>::value,
bool>::type
345 signbit(_A1) _NOEXCEPT
348 #elif defined(_LIBCPP_MSVCRT)
350 template <
typename _A1>
351 inline _LIBCPP_INLINE_VISIBILITY
352 typename std::enable_if<std::is_floating_point<_A1>::value,
bool>::type
353 signbit(_A1 __lcpp_x) _NOEXCEPT
355 return ::signbit(
static_cast<typename std::__promote<_A1>::type
>(__lcpp_x));
359 inline _LIBCPP_INLINE_VISIBILITY
360 typename std::enable_if<
361 std::is_integral<_A1>::value && std::is_signed<_A1>::value,
bool>::type
362 signbit(_A1 __lcpp_x) _NOEXCEPT
363 {
return __lcpp_x < 0; }
366 inline _LIBCPP_INLINE_VISIBILITY
367 typename std::enable_if<
368 std::is_integral<_A1>::value && !std::is_signed<_A1>::value,
bool>::type
369 signbit(_A1) _NOEXCEPT
379 _LIBCPP_INLINE_VISIBILITY
381 __libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
383 return fpclassify(__lcpp_x);
389 inline _LIBCPP_INLINE_VISIBILITY
390 typename std::enable_if<std::is_floating_point<_A1>::value,
int>::type
391 fpclassify(_A1 __lcpp_x) _NOEXCEPT
393 return __libcpp_fpclassify((
typename std::__promote<_A1>::type)__lcpp_x);
397 inline _LIBCPP_INLINE_VISIBILITY
398 typename std::enable_if<std::is_integral<_A1>::value,
int>::type
399 fpclassify(_A1 __lcpp_x) _NOEXCEPT
400 {
return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
402 #elif defined(_LIBCPP_MSVCRT)
404 template <
typename _A1>
405 inline _LIBCPP_INLINE_VISIBILITY
406 typename std::enable_if<std::is_floating_point<_A1>::value,
bool>::type
407 fpclassify(_A1 __lcpp_x) _NOEXCEPT
409 return ::fpclassify(
static_cast<typename std::__promote<_A1>::type
>(__lcpp_x));
413 inline _LIBCPP_INLINE_VISIBILITY
414 typename std::enable_if<std::is_integral<_A1>::value,
int>::type
415 fpclassify(_A1 __lcpp_x) _NOEXCEPT
416 {
return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
425 _LIBCPP_INLINE_VISIBILITY
427 __libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
429 return isfinite(__lcpp_x);
435 inline _LIBCPP_INLINE_VISIBILITY
436 typename std::enable_if<
437 std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
439 isfinite(_A1 __lcpp_x) _NOEXCEPT
441 return __libcpp_isfinite((
typename std::__promote<_A1>::type)__lcpp_x);
445 inline _LIBCPP_INLINE_VISIBILITY
446 typename std::enable_if<
447 std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
449 isfinite(_A1) _NOEXCEPT
459 _LIBCPP_INLINE_VISIBILITY
461 __libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
463 return isinf(__lcpp_x);
469 inline _LIBCPP_INLINE_VISIBILITY
470 typename std::enable_if<
471 std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
473 isinf(_A1 __lcpp_x) _NOEXCEPT
475 return __libcpp_isinf((
typename std::__promote<_A1>::type)__lcpp_x);
479 inline _LIBCPP_INLINE_VISIBILITY
480 typename std::enable_if<
481 std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
486 #ifdef _LIBCPP_PREFERRED_OVERLOAD
487 inline _LIBCPP_INLINE_VISIBILITY
489 isinf(
float __lcpp_x) _NOEXCEPT {
return __libcpp_isinf(__lcpp_x); }
491 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
493 isinf(
double __lcpp_x) _NOEXCEPT {
return __libcpp_isinf(__lcpp_x); }
495 inline _LIBCPP_INLINE_VISIBILITY
497 isinf(
long double __lcpp_x) _NOEXCEPT {
return __libcpp_isinf(__lcpp_x); }
507 _LIBCPP_INLINE_VISIBILITY
509 __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
511 return isnan(__lcpp_x);
517 inline _LIBCPP_INLINE_VISIBILITY
518 typename std::enable_if<std::is_floating_point<_A1>::value,
bool>::type
519 isnan(_A1 __lcpp_x) _NOEXCEPT
521 return __libcpp_isnan((
typename std::__promote<_A1>::type)__lcpp_x);
525 inline _LIBCPP_INLINE_VISIBILITY
526 typename std::enable_if<std::is_integral<_A1>::value,
bool>::type
530 #ifdef _LIBCPP_PREFERRED_OVERLOAD
531 inline _LIBCPP_INLINE_VISIBILITY
533 isnan(
float __lcpp_x) _NOEXCEPT {
return __libcpp_isnan(__lcpp_x); }
535 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
537 isnan(
double __lcpp_x) _NOEXCEPT {
return __libcpp_isnan(__lcpp_x); }
539 inline _LIBCPP_INLINE_VISIBILITY
541 isnan(
long double __lcpp_x) _NOEXCEPT {
return __libcpp_isnan(__lcpp_x); }
551 _LIBCPP_INLINE_VISIBILITY
553 __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
555 return isnormal(__lcpp_x);
561 inline _LIBCPP_INLINE_VISIBILITY
562 typename std::enable_if<std::is_floating_point<_A1>::value,
bool>::type
563 isnormal(_A1 __lcpp_x) _NOEXCEPT
565 return __libcpp_isnormal((
typename std::__promote<_A1>::type)__lcpp_x);
569 inline _LIBCPP_INLINE_VISIBILITY
570 typename std::enable_if<std::is_integral<_A1>::value,
bool>::type
571 isnormal(_A1 __lcpp_x) _NOEXCEPT
572 {
return __lcpp_x != 0; }
580 template <
class _A1,
class _A2>
581 _LIBCPP_INLINE_VISIBILITY
583 __libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
585 return isgreater(__lcpp_x, __lcpp_y);
590 template <
class _A1,
class _A2>
591 inline _LIBCPP_INLINE_VISIBILITY
592 typename std::enable_if
594 std::is_arithmetic<_A1>::value &&
595 std::is_arithmetic<_A2>::value,
598 isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
600 typedef typename std::__promote<_A1, _A2>::type type;
601 return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
608 #ifdef isgreaterequal
610 template <
class _A1,
class _A2>
611 _LIBCPP_INLINE_VISIBILITY
613 __libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
615 return isgreaterequal(__lcpp_x, __lcpp_y);
618 #undef isgreaterequal
620 template <
class _A1,
class _A2>
621 inline _LIBCPP_INLINE_VISIBILITY
622 typename std::enable_if
624 std::is_arithmetic<_A1>::value &&
625 std::is_arithmetic<_A2>::value,
628 isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
630 typedef typename std::__promote<_A1, _A2>::type type;
631 return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
634 #endif // isgreaterequal
640 template <
class _A1,
class _A2>
641 _LIBCPP_INLINE_VISIBILITY
643 __libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
645 return isless(__lcpp_x, __lcpp_y);
650 template <
class _A1,
class _A2>
651 inline _LIBCPP_INLINE_VISIBILITY
652 typename std::enable_if
654 std::is_arithmetic<_A1>::value &&
655 std::is_arithmetic<_A2>::value,
658 isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
660 typedef typename std::__promote<_A1, _A2>::type type;
661 return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
670 template <
class _A1,
class _A2>
671 _LIBCPP_INLINE_VISIBILITY
673 __libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
675 return islessequal(__lcpp_x, __lcpp_y);
680 template <
class _A1,
class _A2>
681 inline _LIBCPP_INLINE_VISIBILITY
682 typename std::enable_if
684 std::is_arithmetic<_A1>::value &&
685 std::is_arithmetic<_A2>::value,
688 islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
690 typedef typename std::__promote<_A1, _A2>::type type;
691 return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
694 #endif // islessequal
700 template <
class _A1,
class _A2>
701 _LIBCPP_INLINE_VISIBILITY
703 __libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
705 return islessgreater(__lcpp_x, __lcpp_y);
710 template <
class _A1,
class _A2>
711 inline _LIBCPP_INLINE_VISIBILITY
712 typename std::enable_if
714 std::is_arithmetic<_A1>::value &&
715 std::is_arithmetic<_A2>::value,
718 islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
720 typedef typename std::__promote<_A1, _A2>::type type;
721 return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
724 #endif // islessgreater
730 template <
class _A1,
class _A2>
731 _LIBCPP_INLINE_VISIBILITY
733 __libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
735 return isunordered(__lcpp_x, __lcpp_y);
740 template <
class _A1,
class _A2>
741 inline _LIBCPP_INLINE_VISIBILITY
742 typename std::enable_if
744 std::is_arithmetic<_A1>::value &&
745 std::is_arithmetic<_A2>::value,
748 isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
750 typedef typename std::__promote<_A1, _A2>::type type;
751 return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
754 #endif // isunordered
758 #if !(defined(_AIX) || defined(__sun__))
759 inline _LIBCPP_INLINE_VISIBILITY
761 abs(
float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
763 inline _LIBCPP_INLINE_VISIBILITY
765 abs(
double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);}
767 inline _LIBCPP_INLINE_VISIBILITY
769 abs(
long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
770 #endif // !(defined(_AIX) || defined(__sun__))
774 #if !(defined(_AIX) || defined(__sun__))
775 inline _LIBCPP_INLINE_VISIBILITY
float acos(
float __lcpp_x) _NOEXCEPT {return ::acosf(__lcpp_x);}
776 inline _LIBCPP_INLINE_VISIBILITY
long double acos(
long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
780 inline _LIBCPP_INLINE_VISIBILITY
781 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
782 acos(_A1 __lcpp_x) _NOEXCEPT {return ::acos((
double)__lcpp_x);}
786 #if !(defined(_AIX) || defined(__sun__))
787 inline _LIBCPP_INLINE_VISIBILITY
float asin(
float __lcpp_x) _NOEXCEPT {return ::asinf(__lcpp_x);}
788 inline _LIBCPP_INLINE_VISIBILITY
long double asin(
long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);}
792 inline _LIBCPP_INLINE_VISIBILITY
793 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
794 asin(_A1 __lcpp_x) _NOEXCEPT {return ::asin((
double)__lcpp_x);}
798 #if !(defined(_AIX) || defined(__sun__))
799 inline _LIBCPP_INLINE_VISIBILITY
float atan(
float __lcpp_x) _NOEXCEPT {return ::atanf(__lcpp_x);}
800 inline _LIBCPP_INLINE_VISIBILITY
long double atan(
long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);}
804 inline _LIBCPP_INLINE_VISIBILITY
805 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
806 atan(_A1 __lcpp_x) _NOEXCEPT {return ::atan((
double)__lcpp_x);}
810 #if !(defined(_AIX) || defined(__sun__))
811 inline _LIBCPP_INLINE_VISIBILITY
float atan2(
float __lcpp_y,
float __lcpp_x) _NOEXCEPT {return ::atan2f(__lcpp_y, __lcpp_x);}
812 inline _LIBCPP_INLINE_VISIBILITY
long double atan2(
long double __lcpp_y,
long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);}
815 template <
class _A1,
class _A2>
816 inline _LIBCPP_INLINE_VISIBILITY
817 typename std::__lazy_enable_if
819 std::is_arithmetic<_A1>::value &&
820 std::is_arithmetic<_A2>::value,
821 std::__promote<_A1, _A2>
823 atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
825 typedef typename std::__promote<_A1, _A2>::type __result_type;
826 static_assert((!(std::is_same<_A1, __result_type>::value &&
827 std::is_same<_A2, __result_type>::value)),
"");
828 return ::atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
833 #if !(defined(_AIX) || defined(__sun__))
834 inline _LIBCPP_INLINE_VISIBILITY
float ceil(
float __lcpp_x) _NOEXCEPT {return ::ceilf(__lcpp_x);}
835 inline _LIBCPP_INLINE_VISIBILITY
long double ceil(
long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);}
839 inline _LIBCPP_INLINE_VISIBILITY
840 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
841 ceil(_A1 __lcpp_x) _NOEXCEPT {return ::ceil((
double)__lcpp_x);}
845 #if !(defined(_AIX) || defined(__sun__))
846 inline _LIBCPP_INLINE_VISIBILITY
float cos(
float __lcpp_x) _NOEXCEPT {return ::cosf(__lcpp_x);}
847 inline _LIBCPP_INLINE_VISIBILITY
long double cos(
long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);}
851 inline _LIBCPP_INLINE_VISIBILITY
852 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
853 cos(_A1 __lcpp_x) _NOEXCEPT {return ::cos((
double)__lcpp_x);}
857 #if !(defined(_AIX) || defined(__sun__))
858 inline _LIBCPP_INLINE_VISIBILITY
float cosh(
float __lcpp_x) _NOEXCEPT {return ::coshf(__lcpp_x);}
859 inline _LIBCPP_INLINE_VISIBILITY
long double cosh(
long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);}
863 inline _LIBCPP_INLINE_VISIBILITY
864 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
865 cosh(_A1 __lcpp_x) _NOEXCEPT {return ::cosh((
double)__lcpp_x);}
869 #if !(defined(_AIX) || defined(__sun__))
870 inline _LIBCPP_INLINE_VISIBILITY
float exp(
float __lcpp_x) _NOEXCEPT {return ::expf(__lcpp_x);}
871 inline _LIBCPP_INLINE_VISIBILITY
long double exp(
long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);}
875 inline _LIBCPP_INLINE_VISIBILITY
876 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
877 exp(_A1 __lcpp_x) _NOEXCEPT {return ::exp((
double)__lcpp_x);}
881 #if !(defined(_AIX) || defined(__sun__))
882 inline _LIBCPP_INLINE_VISIBILITY
float fabs(
float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
883 inline _LIBCPP_INLINE_VISIBILITY
long double fabs(
long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
887 inline _LIBCPP_INLINE_VISIBILITY
888 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
889 fabs(_A1 __lcpp_x) _NOEXCEPT {return ::fabs((
double)__lcpp_x);}
893 #if !(defined(_AIX) || defined(__sun__))
894 inline _LIBCPP_INLINE_VISIBILITY
float floor(
float __lcpp_x) _NOEXCEPT {return ::floorf(__lcpp_x);}
895 inline _LIBCPP_INLINE_VISIBILITY
long double floor(
long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);}
899 inline _LIBCPP_INLINE_VISIBILITY
900 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
901 floor(_A1 __lcpp_x) _NOEXCEPT {return ::floor((
double)__lcpp_x);}
905 #if !(defined(_AIX) || defined(__sun__))
906 inline _LIBCPP_INLINE_VISIBILITY
float fmod(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::fmodf(__lcpp_x, __lcpp_y);}
907 inline _LIBCPP_INLINE_VISIBILITY
long double fmod(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);}
910 template <
class _A1,
class _A2>
911 inline _LIBCPP_INLINE_VISIBILITY
912 typename std::__lazy_enable_if
914 std::is_arithmetic<_A1>::value &&
915 std::is_arithmetic<_A2>::value,
916 std::__promote<_A1, _A2>
918 fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
920 typedef typename std::__promote<_A1, _A2>::type __result_type;
921 static_assert((!(std::is_same<_A1, __result_type>::value &&
922 std::is_same<_A2, __result_type>::value)),
"");
923 return ::fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
928 #if !(defined(_AIX) || defined(__sun__))
929 inline _LIBCPP_INLINE_VISIBILITY
float frexp(
float __lcpp_x,
int* __lcpp_e) _NOEXCEPT {return ::frexpf(__lcpp_x, __lcpp_e);}
930 inline _LIBCPP_INLINE_VISIBILITY
long double frexp(
long double __lcpp_x,
int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);}
934 inline _LIBCPP_INLINE_VISIBILITY
935 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
936 frexp(_A1 __lcpp_x,
int* __lcpp_e) _NOEXCEPT {return ::frexp((
double)__lcpp_x, __lcpp_e);}
940 #if !(defined(_AIX) || defined(__sun__))
941 inline _LIBCPP_INLINE_VISIBILITY
float ldexp(
float __lcpp_x,
int __lcpp_e) _NOEXCEPT {return ::ldexpf(__lcpp_x, __lcpp_e);}
942 inline _LIBCPP_INLINE_VISIBILITY
long double ldexp(
long double __lcpp_x,
int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);}
946 inline _LIBCPP_INLINE_VISIBILITY
947 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
948 ldexp(_A1 __lcpp_x,
int __lcpp_e) _NOEXCEPT {return ::ldexp((
double)__lcpp_x, __lcpp_e);}
952 #if !(defined(_AIX) || defined(__sun__))
953 inline _LIBCPP_INLINE_VISIBILITY
float log(
float __lcpp_x) _NOEXCEPT {return ::logf(__lcpp_x);}
954 inline _LIBCPP_INLINE_VISIBILITY
long double log(
long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);}
958 inline _LIBCPP_INLINE_VISIBILITY
959 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
960 log(_A1 __lcpp_x) _NOEXCEPT {return ::log((
double)__lcpp_x);}
964 #if !(defined(_AIX) || defined(__sun__))
965 inline _LIBCPP_INLINE_VISIBILITY
float log10(
float __lcpp_x) _NOEXCEPT {return ::log10f(__lcpp_x);}
966 inline _LIBCPP_INLINE_VISIBILITY
long double log10(
long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);}
970 inline _LIBCPP_INLINE_VISIBILITY
971 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
972 log10(_A1 __lcpp_x) _NOEXCEPT {return ::log10((
double)__lcpp_x);}
976 #if !(defined(_AIX) || defined(__sun__))
977 inline _LIBCPP_INLINE_VISIBILITY
float modf(
float __lcpp_x,
float* __lcpp_y) _NOEXCEPT {return ::modff(__lcpp_x, __lcpp_y);}
978 inline _LIBCPP_INLINE_VISIBILITY
long double modf(
long double __lcpp_x,
long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);}
983 #if !(defined(_AIX) || defined(__sun__))
984 inline _LIBCPP_INLINE_VISIBILITY
float pow(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::powf(__lcpp_x, __lcpp_y);}
985 inline _LIBCPP_INLINE_VISIBILITY
long double pow(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);}
988 template <
class _A1,
class _A2>
989 inline _LIBCPP_INLINE_VISIBILITY
990 typename std::__lazy_enable_if
992 std::is_arithmetic<_A1>::value &&
993 std::is_arithmetic<_A2>::value,
994 std::__promote<_A1, _A2>
996 pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
998 typedef typename std::__promote<_A1, _A2>::type __result_type;
999 static_assert((!(std::is_same<_A1, __result_type>::value &&
1000 std::is_same<_A2, __result_type>::value)),
"");
1001 return ::pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1006 #if !(defined(_AIX) || defined(__sun__))
1007 inline _LIBCPP_INLINE_VISIBILITY
float sin(
float __lcpp_x) _NOEXCEPT {return ::sinf(__lcpp_x);}
1008 inline _LIBCPP_INLINE_VISIBILITY
long double sin(
long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);}
1011 template <
class _A1>
1012 inline _LIBCPP_INLINE_VISIBILITY
1013 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1014 sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((
double)__lcpp_x);}
1018 #if !(defined(_AIX) || defined(__sun__))
1019 inline _LIBCPP_INLINE_VISIBILITY
float sinh(
float __lcpp_x) _NOEXCEPT {return ::sinhf(__lcpp_x);}
1020 inline _LIBCPP_INLINE_VISIBILITY
long double sinh(
long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);}
1023 template <
class _A1>
1024 inline _LIBCPP_INLINE_VISIBILITY
1025 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1026 sinh(_A1 __lcpp_x) _NOEXCEPT {return ::sinh((
double)__lcpp_x);}
1030 #if !(defined(_AIX) || defined(__sun__))
1031 inline _LIBCPP_INLINE_VISIBILITY
float sqrt(
float __lcpp_x) _NOEXCEPT {return ::sqrtf(__lcpp_x);}
1032 inline _LIBCPP_INLINE_VISIBILITY
long double sqrt(
long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
1035 template <
class _A1>
1036 inline _LIBCPP_INLINE_VISIBILITY
1037 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1038 sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((
double)__lcpp_x);}
1042 #if !(defined(_AIX) || defined(__sun__))
1043 inline _LIBCPP_INLINE_VISIBILITY
float tan(
float __lcpp_x) _NOEXCEPT {return ::tanf(__lcpp_x);}
1044 inline _LIBCPP_INLINE_VISIBILITY
long double tan(
long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);}
1047 template <
class _A1>
1048 inline _LIBCPP_INLINE_VISIBILITY
1049 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1050 tan(_A1 __lcpp_x) _NOEXCEPT {return ::tan((
double)__lcpp_x);}
1054 #if !(defined(_AIX) || defined(__sun__))
1055 inline _LIBCPP_INLINE_VISIBILITY
float tanh(
float __lcpp_x) _NOEXCEPT {return ::tanhf(__lcpp_x);}
1056 inline _LIBCPP_INLINE_VISIBILITY
long double tanh(
long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);}
1059 template <
class _A1>
1060 inline _LIBCPP_INLINE_VISIBILITY
1061 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1062 tanh(_A1 __lcpp_x) _NOEXCEPT {return ::tanh((
double)__lcpp_x);}
1066 inline _LIBCPP_INLINE_VISIBILITY
float acosh(
float __lcpp_x) _NOEXCEPT {return ::acoshf(__lcpp_x);}
1067 inline _LIBCPP_INLINE_VISIBILITY
long double acosh(
long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);}
1069 template <
class _A1>
1070 inline _LIBCPP_INLINE_VISIBILITY
1071 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1072 acosh(_A1 __lcpp_x) _NOEXCEPT {return ::acosh((
double)__lcpp_x);}
1076 inline _LIBCPP_INLINE_VISIBILITY
float asinh(
float __lcpp_x) _NOEXCEPT {return ::asinhf(__lcpp_x);}
1077 inline _LIBCPP_INLINE_VISIBILITY
long double asinh(
long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);}
1079 template <
class _A1>
1080 inline _LIBCPP_INLINE_VISIBILITY
1081 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1082 asinh(_A1 __lcpp_x) _NOEXCEPT {return ::asinh((
double)__lcpp_x);}
1086 inline _LIBCPP_INLINE_VISIBILITY
float atanh(
float __lcpp_x) _NOEXCEPT {return ::atanhf(__lcpp_x);}
1087 inline _LIBCPP_INLINE_VISIBILITY
long double atanh(
long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);}
1089 template <
class _A1>
1090 inline _LIBCPP_INLINE_VISIBILITY
1091 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1092 atanh(_A1 __lcpp_x) _NOEXCEPT {return ::atanh((
double)__lcpp_x);}
1096 inline _LIBCPP_INLINE_VISIBILITY
float cbrt(
float __lcpp_x) _NOEXCEPT {return ::cbrtf(__lcpp_x);}
1097 inline _LIBCPP_INLINE_VISIBILITY
long double cbrt(
long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);}
1099 template <
class _A1>
1100 inline _LIBCPP_INLINE_VISIBILITY
1101 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1102 cbrt(_A1 __lcpp_x) _NOEXCEPT {return ::cbrt((
double)__lcpp_x);}
1106 inline _LIBCPP_INLINE_VISIBILITY
float copysign(
float __lcpp_x,
1107 float __lcpp_y) _NOEXCEPT {
1108 return ::copysignf(__lcpp_x, __lcpp_y);
1110 inline _LIBCPP_INLINE_VISIBILITY
long double
1111 copysign(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {
1112 return ::copysignl(__lcpp_x, __lcpp_y);
1115 template <
class _A1,
class _A2>
1116 inline _LIBCPP_INLINE_VISIBILITY
1117 typename std::__lazy_enable_if
1119 std::is_arithmetic<_A1>::value &&
1120 std::is_arithmetic<_A2>::value,
1121 std::__promote<_A1, _A2>
1123 copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1125 typedef typename std::__promote<_A1, _A2>::type __result_type;
1126 static_assert((!(std::is_same<_A1, __result_type>::value &&
1127 std::is_same<_A2, __result_type>::value)),
"");
1128 return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1133 inline _LIBCPP_INLINE_VISIBILITY
float erf(
float __lcpp_x) _NOEXCEPT {return ::erff(__lcpp_x);}
1134 inline _LIBCPP_INLINE_VISIBILITY
long double erf(
long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);}
1136 template <
class _A1>
1137 inline _LIBCPP_INLINE_VISIBILITY
1138 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1139 erf(_A1 __lcpp_x) _NOEXCEPT {return ::erf((
double)__lcpp_x);}
1143 inline _LIBCPP_INLINE_VISIBILITY
float erfc(
float __lcpp_x) _NOEXCEPT {return ::erfcf(__lcpp_x);}
1144 inline _LIBCPP_INLINE_VISIBILITY
long double erfc(
long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);}
1146 template <
class _A1>
1147 inline _LIBCPP_INLINE_VISIBILITY
1148 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1149 erfc(_A1 __lcpp_x) _NOEXCEPT {return ::erfc((
double)__lcpp_x);}
1153 inline _LIBCPP_INLINE_VISIBILITY
float exp2(
float __lcpp_x) _NOEXCEPT {return ::exp2f(__lcpp_x);}
1154 inline _LIBCPP_INLINE_VISIBILITY
long double exp2(
long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);}
1156 template <
class _A1>
1157 inline _LIBCPP_INLINE_VISIBILITY
1158 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1159 exp2(_A1 __lcpp_x) _NOEXCEPT {return ::exp2((
double)__lcpp_x);}
1163 inline _LIBCPP_INLINE_VISIBILITY
float expm1(
float __lcpp_x) _NOEXCEPT {return ::expm1f(__lcpp_x);}
1164 inline _LIBCPP_INLINE_VISIBILITY
long double expm1(
long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);}
1166 template <
class _A1>
1167 inline _LIBCPP_INLINE_VISIBILITY
1168 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1169 expm1(_A1 __lcpp_x) _NOEXCEPT {return ::expm1((
double)__lcpp_x);}
1173 inline _LIBCPP_INLINE_VISIBILITY
float fdim(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::fdimf(__lcpp_x, __lcpp_y);}
1174 inline _LIBCPP_INLINE_VISIBILITY
long double fdim(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);}
1176 template <
class _A1,
class _A2>
1177 inline _LIBCPP_INLINE_VISIBILITY
1178 typename std::__lazy_enable_if
1180 std::is_arithmetic<_A1>::value &&
1181 std::is_arithmetic<_A2>::value,
1182 std::__promote<_A1, _A2>
1184 fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1186 typedef typename std::__promote<_A1, _A2>::type __result_type;
1187 static_assert((!(std::is_same<_A1, __result_type>::value &&
1188 std::is_same<_A2, __result_type>::value)),
"");
1189 return ::fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1194 inline _LIBCPP_INLINE_VISIBILITY
float fma(
float __lcpp_x,
float __lcpp_y,
float __lcpp_z) _NOEXCEPT {return ::fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
1195 inline _LIBCPP_INLINE_VISIBILITY
long double fma(
long double __lcpp_x,
long double __lcpp_y,
long double __lcpp_z) _NOEXCEPT {return ::fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
1197 template <
class _A1,
class _A2,
class _A3>
1198 inline _LIBCPP_INLINE_VISIBILITY
1199 typename std::__lazy_enable_if
1201 std::is_arithmetic<_A1>::value &&
1202 std::is_arithmetic<_A2>::value &&
1203 std::is_arithmetic<_A3>::value,
1204 std::__promote<_A1, _A2, _A3>
1206 fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
1208 typedef typename std::__promote<_A1, _A2, _A3>::type __result_type;
1209 static_assert((!(std::is_same<_A1, __result_type>::value &&
1210 std::is_same<_A2, __result_type>::value &&
1211 std::is_same<_A3, __result_type>::value)),
"");
1212 return ::fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
1217 inline _LIBCPP_INLINE_VISIBILITY
float fmax(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::fmaxf(__lcpp_x, __lcpp_y);}
1218 inline _LIBCPP_INLINE_VISIBILITY
long double fmax(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);}
1220 template <
class _A1,
class _A2>
1221 inline _LIBCPP_INLINE_VISIBILITY
1222 typename std::__lazy_enable_if
1224 std::is_arithmetic<_A1>::value &&
1225 std::is_arithmetic<_A2>::value,
1226 std::__promote<_A1, _A2>
1228 fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1230 typedef typename std::__promote<_A1, _A2>::type __result_type;
1231 static_assert((!(std::is_same<_A1, __result_type>::value &&
1232 std::is_same<_A2, __result_type>::value)),
"");
1233 return ::fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1238 inline _LIBCPP_INLINE_VISIBILITY
float fmin(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::fminf(__lcpp_x, __lcpp_y);}
1239 inline _LIBCPP_INLINE_VISIBILITY
long double fmin(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);}
1241 template <
class _A1,
class _A2>
1242 inline _LIBCPP_INLINE_VISIBILITY
1243 typename std::__lazy_enable_if
1245 std::is_arithmetic<_A1>::value &&
1246 std::is_arithmetic<_A2>::value,
1247 std::__promote<_A1, _A2>
1249 fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1251 typedef typename std::__promote<_A1, _A2>::type __result_type;
1252 static_assert((!(std::is_same<_A1, __result_type>::value &&
1253 std::is_same<_A2, __result_type>::value)),
"");
1254 return ::fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1259 inline _LIBCPP_INLINE_VISIBILITY
float hypot(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::hypotf(__lcpp_x, __lcpp_y);}
1260 inline _LIBCPP_INLINE_VISIBILITY
long double hypot(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);}
1262 template <
class _A1,
class _A2>
1263 inline _LIBCPP_INLINE_VISIBILITY
1264 typename std::__lazy_enable_if
1266 std::is_arithmetic<_A1>::value &&
1267 std::is_arithmetic<_A2>::value,
1268 std::__promote<_A1, _A2>
1270 hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1272 typedef typename std::__promote<_A1, _A2>::type __result_type;
1273 static_assert((!(std::is_same<_A1, __result_type>::value &&
1274 std::is_same<_A2, __result_type>::value)),
"");
1275 return ::hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1280 inline _LIBCPP_INLINE_VISIBILITY
int ilogb(
float __lcpp_x) _NOEXCEPT {return ::ilogbf(__lcpp_x);}
1281 inline _LIBCPP_INLINE_VISIBILITY
int ilogb(
long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);}
1283 template <
class _A1>
1284 inline _LIBCPP_INLINE_VISIBILITY
1285 typename std::enable_if<std::is_integral<_A1>::value,
int>::type
1286 ilogb(_A1 __lcpp_x) _NOEXCEPT {return ::ilogb((
double)__lcpp_x);}
1290 inline _LIBCPP_INLINE_VISIBILITY
float lgamma(
float __lcpp_x) _NOEXCEPT {return ::lgammaf(__lcpp_x);}
1291 inline _LIBCPP_INLINE_VISIBILITY
long double lgamma(
long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);}
1293 template <
class _A1>
1294 inline _LIBCPP_INLINE_VISIBILITY
1295 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1296 lgamma(_A1 __lcpp_x) _NOEXCEPT {return ::lgamma((
double)__lcpp_x);}
1300 inline _LIBCPP_INLINE_VISIBILITY
long long llrint(
float __lcpp_x) _NOEXCEPT {return ::llrintf(__lcpp_x);}
1301 inline _LIBCPP_INLINE_VISIBILITY
long long llrint(
long double __lcpp_x) _NOEXCEPT {return ::llrintl(__lcpp_x);}
1303 template <
class _A1>
1304 inline _LIBCPP_INLINE_VISIBILITY
1305 typename std::enable_if<std::is_integral<_A1>::value,
long long>::type
1306 llrint(_A1 __lcpp_x) _NOEXCEPT {return ::llrint((
double)__lcpp_x);}
1310 inline _LIBCPP_INLINE_VISIBILITY
long long llround(
float __lcpp_x) _NOEXCEPT {return ::llroundf(__lcpp_x);}
1311 inline _LIBCPP_INLINE_VISIBILITY
long long llround(
long double __lcpp_x) _NOEXCEPT {return ::llroundl(__lcpp_x);}
1313 template <
class _A1>
1314 inline _LIBCPP_INLINE_VISIBILITY
1315 typename std::enable_if<std::is_integral<_A1>::value,
long long>::type
1316 llround(_A1 __lcpp_x) _NOEXCEPT {return ::llround((
double)__lcpp_x);}
1320 inline _LIBCPP_INLINE_VISIBILITY
float log1p(
float __lcpp_x) _NOEXCEPT {return ::log1pf(__lcpp_x);}
1321 inline _LIBCPP_INLINE_VISIBILITY
long double log1p(
long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);}
1323 template <
class _A1>
1324 inline _LIBCPP_INLINE_VISIBILITY
1325 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1326 log1p(_A1 __lcpp_x) _NOEXCEPT {return ::log1p((
double)__lcpp_x);}
1330 inline _LIBCPP_INLINE_VISIBILITY
float log2(
float __lcpp_x) _NOEXCEPT {return ::log2f(__lcpp_x);}
1331 inline _LIBCPP_INLINE_VISIBILITY
long double log2(
long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);}
1333 template <
class _A1>
1334 inline _LIBCPP_INLINE_VISIBILITY
1335 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1336 log2(_A1 __lcpp_x) _NOEXCEPT {return ::log2((
double)__lcpp_x);}
1340 inline _LIBCPP_INLINE_VISIBILITY
float logb(
float __lcpp_x) _NOEXCEPT {return ::logbf(__lcpp_x);}
1341 inline _LIBCPP_INLINE_VISIBILITY
long double logb(
long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);}
1343 template <
class _A1>
1344 inline _LIBCPP_INLINE_VISIBILITY
1345 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1346 logb(_A1 __lcpp_x) _NOEXCEPT {return ::logb((
double)__lcpp_x);}
1350 inline _LIBCPP_INLINE_VISIBILITY
long lrint(
float __lcpp_x) _NOEXCEPT {return ::lrintf(__lcpp_x);}
1351 inline _LIBCPP_INLINE_VISIBILITY
long lrint(
long double __lcpp_x) _NOEXCEPT {return ::lrintl(__lcpp_x);}
1353 template <
class _A1>
1354 inline _LIBCPP_INLINE_VISIBILITY
1355 typename std::enable_if<std::is_integral<_A1>::value,
long>::type
1356 lrint(_A1 __lcpp_x) _NOEXCEPT {return ::lrint((
double)__lcpp_x);}
1360 inline _LIBCPP_INLINE_VISIBILITY
long lround(
float __lcpp_x) _NOEXCEPT {return ::lroundf(__lcpp_x);}
1361 inline _LIBCPP_INLINE_VISIBILITY
long lround(
long double __lcpp_x) _NOEXCEPT {return ::lroundl(__lcpp_x);}
1363 template <
class _A1>
1364 inline _LIBCPP_INLINE_VISIBILITY
1365 typename std::enable_if<std::is_integral<_A1>::value,
long>::type
1366 lround(_A1 __lcpp_x) _NOEXCEPT {return ::lround((
double)__lcpp_x);}
1372 inline _LIBCPP_INLINE_VISIBILITY
float nearbyint(
float __lcpp_x) _NOEXCEPT {return ::nearbyintf(__lcpp_x);}
1373 inline _LIBCPP_INLINE_VISIBILITY
long double nearbyint(
long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);}
1375 template <
class _A1>
1376 inline _LIBCPP_INLINE_VISIBILITY
1377 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1378 nearbyint(_A1 __lcpp_x) _NOEXCEPT {return ::nearbyint((
double)__lcpp_x);}
1382 inline _LIBCPP_INLINE_VISIBILITY
float nextafter(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::nextafterf(__lcpp_x, __lcpp_y);}
1383 inline _LIBCPP_INLINE_VISIBILITY
long double nextafter(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);}
1385 template <
class _A1,
class _A2>
1386 inline _LIBCPP_INLINE_VISIBILITY
1387 typename std::__lazy_enable_if
1389 std::is_arithmetic<_A1>::value &&
1390 std::is_arithmetic<_A2>::value,
1391 std::__promote<_A1, _A2>
1393 nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1395 typedef typename std::__promote<_A1, _A2>::type __result_type;
1396 static_assert((!(std::is_same<_A1, __result_type>::value &&
1397 std::is_same<_A2, __result_type>::value)),
"");
1398 return ::nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1403 inline _LIBCPP_INLINE_VISIBILITY
float nexttoward(
float __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::nexttowardf(__lcpp_x, __lcpp_y);}
1404 inline _LIBCPP_INLINE_VISIBILITY
long double nexttoward(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);}
1406 template <
class _A1>
1407 inline _LIBCPP_INLINE_VISIBILITY
1408 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1409 nexttoward(_A1 __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::nexttoward((
double)__lcpp_x, __lcpp_y);}
1413 inline _LIBCPP_INLINE_VISIBILITY
float remainder(
float __lcpp_x,
float __lcpp_y) _NOEXCEPT {return ::remainderf(__lcpp_x, __lcpp_y);}
1414 inline _LIBCPP_INLINE_VISIBILITY
long double remainder(
long double __lcpp_x,
long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);}
1416 template <
class _A1,
class _A2>
1417 inline _LIBCPP_INLINE_VISIBILITY
1418 typename std::__lazy_enable_if
1420 std::is_arithmetic<_A1>::value &&
1421 std::is_arithmetic<_A2>::value,
1422 std::__promote<_A1, _A2>
1424 remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1426 typedef typename std::__promote<_A1, _A2>::type __result_type;
1427 static_assert((!(std::is_same<_A1, __result_type>::value &&
1428 std::is_same<_A2, __result_type>::value)),
"");
1429 return ::remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1434 inline _LIBCPP_INLINE_VISIBILITY
float remquo(
float __lcpp_x,
float __lcpp_y,
int* __lcpp_z) _NOEXCEPT {return ::remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
1435 inline _LIBCPP_INLINE_VISIBILITY
long double remquo(
long double __lcpp_x,
long double __lcpp_y,
int* __lcpp_z) _NOEXCEPT {return ::remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
1437 template <
class _A1,
class _A2>
1438 inline _LIBCPP_INLINE_VISIBILITY
1439 typename std::__lazy_enable_if
1441 std::is_arithmetic<_A1>::value &&
1442 std::is_arithmetic<_A2>::value,
1443 std::__promote<_A1, _A2>
1445 remquo(_A1 __lcpp_x, _A2 __lcpp_y,
int* __lcpp_z) _NOEXCEPT
1447 typedef typename std::__promote<_A1, _A2>::type __result_type;
1448 static_assert((!(std::is_same<_A1, __result_type>::value &&
1449 std::is_same<_A2, __result_type>::value)),
"");
1450 return ::remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
1455 inline _LIBCPP_INLINE_VISIBILITY
float rint(
float __lcpp_x) _NOEXCEPT {return ::rintf(__lcpp_x);}
1456 inline _LIBCPP_INLINE_VISIBILITY
long double rint(
long double __lcpp_x) _NOEXCEPT {return ::rintl(__lcpp_x);}
1458 template <
class _A1>
1459 inline _LIBCPP_INLINE_VISIBILITY
1460 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1461 rint(_A1 __lcpp_x) _NOEXCEPT {return ::rint((
double)__lcpp_x);}
1465 inline _LIBCPP_INLINE_VISIBILITY
float round(
float __lcpp_x) _NOEXCEPT {return ::roundf(__lcpp_x);}
1466 inline _LIBCPP_INLINE_VISIBILITY
long double round(
long double __lcpp_x) _NOEXCEPT {return ::roundl(__lcpp_x);}
1468 template <
class _A1>
1469 inline _LIBCPP_INLINE_VISIBILITY
1470 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1471 round(_A1 __lcpp_x) _NOEXCEPT {return ::round((
double)__lcpp_x);}
1475 inline _LIBCPP_INLINE_VISIBILITY
float scalbln(
float __lcpp_x,
long __lcpp_y) _NOEXCEPT {return ::scalblnf(__lcpp_x, __lcpp_y);}
1476 inline _LIBCPP_INLINE_VISIBILITY
long double scalbln(
long double __lcpp_x,
long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);}
1478 template <
class _A1>
1479 inline _LIBCPP_INLINE_VISIBILITY
1480 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1481 scalbln(_A1 __lcpp_x,
long __lcpp_y) _NOEXCEPT {return ::scalbln((
double)__lcpp_x, __lcpp_y);}
1485 inline _LIBCPP_INLINE_VISIBILITY
float scalbn(
float __lcpp_x,
int __lcpp_y) _NOEXCEPT {return ::scalbnf(__lcpp_x, __lcpp_y);}
1486 inline _LIBCPP_INLINE_VISIBILITY
long double scalbn(
long double __lcpp_x,
int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);}
1488 template <
class _A1>
1489 inline _LIBCPP_INLINE_VISIBILITY
1490 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1491 scalbn(_A1 __lcpp_x,
int __lcpp_y) _NOEXCEPT {return ::scalbn((
double)__lcpp_x, __lcpp_y);}
1495 inline _LIBCPP_INLINE_VISIBILITY
float tgamma(
float __lcpp_x) _NOEXCEPT {return ::tgammaf(__lcpp_x);}
1496 inline _LIBCPP_INLINE_VISIBILITY
long double tgamma(
long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);}
1498 template <
class _A1>
1499 inline _LIBCPP_INLINE_VISIBILITY
1500 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1501 tgamma(_A1 __lcpp_x) _NOEXCEPT {return ::tgamma((
double)__lcpp_x);}
1505 inline _LIBCPP_INLINE_VISIBILITY
float trunc(
float __lcpp_x) _NOEXCEPT {return ::truncf(__lcpp_x);}
1506 inline _LIBCPP_INLINE_VISIBILITY
long double trunc(
long double __lcpp_x) _NOEXCEPT {return ::truncl(__lcpp_x);}
1508 template <
class _A1>
1509 inline _LIBCPP_INLINE_VISIBILITY
1510 typename std::enable_if<std::is_integral<_A1>::value,
double>::type
1511 trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((
double)__lcpp_x);}
1515 #endif // __cplusplus
1517 #else // _LIBCPP_MATH_H
1527 #if defined(_LIBCPP_MSVCRT) && defined(_USE_MATH_DEFINES)
1528 #include_next <math.h>
1531 #endif // _LIBCPP_MATH_H