2 //===---------------------------- math.h ----------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_MATH_H
12 #define _LIBCPP_MATH_H
36 math_errhandling // C99
45 floating_point abs(floating_point x);
47 floating_point acos (arithmetic x);
49 long double acosl(long double x);
51 floating_point asin (arithmetic x);
53 long double asinl(long double x);
55 floating_point atan (arithmetic x);
57 long double atanl(long double x);
59 floating_point atan2 (arithmetic y, arithmetic x);
60 float atan2f(float y, float x);
61 long double atan2l(long double y, long double x);
63 floating_point ceil (arithmetic x);
65 long double ceill(long double x);
67 floating_point cos (arithmetic x);
69 long double cosl(long double x);
71 floating_point cosh (arithmetic x);
73 long double coshl(long double x);
75 floating_point exp (arithmetic x);
77 long double expl(long double x);
79 floating_point fabs (arithmetic x);
81 long double fabsl(long double x);
83 floating_point floor (arithmetic x);
84 float floorf(float x);
85 long double floorl(long double x);
87 floating_point fmod (arithmetic x, arithmetic y);
88 float fmodf(float x, float y);
89 long double fmodl(long double x, long double y);
91 floating_point frexp (arithmetic value, int* exp);
92 float frexpf(float value, int* exp);
93 long double frexpl(long double value, int* exp);
95 floating_point ldexp (arithmetic value, int exp);
96 float ldexpf(float value, int exp);
97 long double ldexpl(long double value, int exp);
99 floating_point log (arithmetic x);
101 long double logl(long double x);
103 floating_point log10 (arithmetic x);
104 float log10f(float x);
105 long double log10l(long double x);
107 floating_point modf (floating_point value, floating_point* iptr);
108 float modff(float value, float* iptr);
109 long double modfl(long double value, long double* iptr);
111 floating_point pow (arithmetic x, arithmetic y);
112 float powf(float x, float y);
113 long double powl(long double x, long double y);
115 floating_point sin (arithmetic x);
117 long double sinl(long double x);
119 floating_point sinh (arithmetic x);
120 float sinhf(float x);
121 long double sinhl(long double x);
123 floating_point sqrt (arithmetic x);
124 float sqrtf(float x);
125 long double sqrtl(long double x);
127 floating_point tan (arithmetic x);
129 long double tanl(long double x);
131 floating_point tanh (arithmetic x);
132 float tanhf(float x);
133 long double tanhl(long double x);
137 bool signbit(arithmetic x);
139 int fpclassify(arithmetic x);
141 bool isfinite(arithmetic x);
142 bool isinf(arithmetic x);
143 bool isnan(arithmetic x);
144 bool isnormal(arithmetic x);
146 bool isgreater(arithmetic x, arithmetic y);
147 bool isgreaterequal(arithmetic x, arithmetic y);
148 bool isless(arithmetic x, arithmetic y);
149 bool islessequal(arithmetic x, arithmetic y);
150 bool islessgreater(arithmetic x, arithmetic y);
151 bool isunordered(arithmetic x, arithmetic y);
153 floating_point acosh (arithmetic x);
154 float acoshf(float x);
155 long double acoshl(long double x);
157 floating_point asinh (arithmetic x);
158 float asinhf(float x);
159 long double asinhl(long double x);
161 floating_point atanh (arithmetic x);
162 float atanhf(float x);
163 long double atanhl(long double x);
165 floating_point cbrt (arithmetic x);
166 float cbrtf(float x);
167 long double cbrtl(long double x);
169 floating_point copysign (arithmetic x, arithmetic y);
170 float copysignf(float x, float y);
171 long double copysignl(long double x, long double y);
173 floating_point erf (arithmetic x);
175 long double erfl(long double x);
177 floating_point erfc (arithmetic x);
178 float erfcf(float x);
179 long double erfcl(long double x);
181 floating_point exp2 (arithmetic x);
182 float exp2f(float x);
183 long double exp2l(long double x);
185 floating_point expm1 (arithmetic x);
186 float expm1f(float x);
187 long double expm1l(long double x);
189 floating_point fdim (arithmetic x, arithmetic y);
190 float fdimf(float x, float y);
191 long double fdiml(long double x, long double y);
193 floating_point fma (arithmetic x, arithmetic y, arithmetic z);
194 float fmaf(float x, float y, float z);
195 long double fmal(long double x, long double y, long double z);
197 floating_point fmax (arithmetic x, arithmetic y);
198 float fmaxf(float x, float y);
199 long double fmaxl(long double x, long double y);
201 floating_point fmin (arithmetic x, arithmetic y);
202 float fminf(float x, float y);
203 long double fminl(long double x, long double y);
205 floating_point hypot (arithmetic x, arithmetic y);
206 float hypotf(float x, float y);
207 long double hypotl(long double x, long double y);
209 int ilogb (arithmetic x);
211 int ilogbl(long double x);
213 floating_point lgamma (arithmetic x);
214 float lgammaf(float x);
215 long double lgammal(long double x);
217 long long llrint (arithmetic x);
218 long long llrintf(float x);
219 long long llrintl(long double x);
221 long long llround (arithmetic x);
222 long long llroundf(float x);
223 long long llroundl(long double x);
225 floating_point log1p (arithmetic x);
226 float log1pf(float x);
227 long double log1pl(long double x);
229 floating_point log2 (arithmetic x);
230 float log2f(float x);
231 long double log2l(long double x);
233 floating_point logb (arithmetic x);
234 float logbf(float x);
235 long double logbl(long double x);
237 long lrint (arithmetic x);
238 long lrintf(float x);
239 long lrintl(long double x);
241 long lround (arithmetic x);
242 long lroundf(float x);
243 long lroundl(long double x);
245 double nan (const char* str);
246 float nanf(const char* str);
247 long double nanl(const char* str);
249 floating_point nearbyint (arithmetic x);
250 float nearbyintf(float x);
251 long double nearbyintl(long double x);
253 floating_point nextafter (arithmetic x, arithmetic y);
254 float nextafterf(float x, float y);
255 long double nextafterl(long double x, long double y);
257 floating_point nexttoward (arithmetic x, long double y);
258 float nexttowardf(float x, long double y);
259 long double nexttowardl(long double x, long double y);
261 floating_point remainder (arithmetic x, arithmetic y);
262 float remainderf(float x, float y);
263 long double remainderl(long double x, long double y);
265 floating_point remquo (arithmetic x, arithmetic y, int* pquo);
266 float remquof(float x, float y, int* pquo);
267 long double remquol(long double x, long double y, int* pquo);
269 floating_point rint (arithmetic x);
270 float rintf(float x);
271 long double rintl(long double x);
273 floating_point round (arithmetic x);
274 float roundf(float x);
275 long double roundl(long double x);
277 floating_point scalbln (arithmetic x, long ex);
278 float scalblnf(float x, long ex);
279 long double scalblnl(long double x, long ex);
281 floating_point scalbn (arithmetic x, int ex);
282 float scalbnf(float x, int ex);
283 long double scalbnl(long double x, int ex);
285 floating_point tgamma (arithmetic x);
286 float tgammaf(float x);
287 long double tgammal(long double x);
289 floating_point trunc (arithmetic x);
290 float truncf(float x);
291 long double truncl(long double x);
297 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
298 #pragma GCC system_header
301 #include_next <math.h>
305 // We support including .h headers inside 'extern "C"' contexts, so switch
306 // back to C++ linkage before including these C++ headers.
309 #include <type_traits>
317 _LIBCPP_ALWAYS_INLINE
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_ALWAYS_INLINE
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_ALWAYS_INLINE
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_ALWAYS_INLINE
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,
493 _LIBCPP_ALWAYS_INLINE
495 __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
497 return isnan(__lcpp_x);
503 inline _LIBCPP_INLINE_VISIBILITY
504 typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
505 isnan(_A1 __lcpp_x) _NOEXCEPT
507 return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
511 inline _LIBCPP_INLINE_VISIBILITY
512 typename std::enable_if<std::is_integral<_A1>::value, bool>::type
523 _LIBCPP_ALWAYS_INLINE
525 __libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
527 return isnormal(__lcpp_x);
533 inline _LIBCPP_INLINE_VISIBILITY
534 typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
535 isnormal(_A1 __lcpp_x) _NOEXCEPT
537 return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
541 inline _LIBCPP_INLINE_VISIBILITY
542 typename std::enable_if<std::is_integral<_A1>::value, bool>::type
543 isnormal(_A1 __lcpp_x) _NOEXCEPT
544 { return __lcpp_x != 0; }
552 template <class _A1, class _A2>
553 _LIBCPP_ALWAYS_INLINE
555 __libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
557 return isgreater(__lcpp_x, __lcpp_y);
562 template <class _A1, class _A2>
563 inline _LIBCPP_INLINE_VISIBILITY
564 typename std::enable_if
566 std::is_arithmetic<_A1>::value &&
567 std::is_arithmetic<_A2>::value,
570 isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
572 typedef typename std::__promote<_A1, _A2>::type type;
573 return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
580 #ifdef isgreaterequal
582 template <class _A1, class _A2>
583 _LIBCPP_ALWAYS_INLINE
585 __libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
587 return isgreaterequal(__lcpp_x, __lcpp_y);
590 #undef isgreaterequal
592 template <class _A1, class _A2>
593 inline _LIBCPP_INLINE_VISIBILITY
594 typename std::enable_if
596 std::is_arithmetic<_A1>::value &&
597 std::is_arithmetic<_A2>::value,
600 isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
602 typedef typename std::__promote<_A1, _A2>::type type;
603 return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
606 #endif // isgreaterequal
612 template <class _A1, class _A2>
613 _LIBCPP_ALWAYS_INLINE
615 __libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
617 return isless(__lcpp_x, __lcpp_y);
622 template <class _A1, class _A2>
623 inline _LIBCPP_INLINE_VISIBILITY
624 typename std::enable_if
626 std::is_arithmetic<_A1>::value &&
627 std::is_arithmetic<_A2>::value,
630 isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
632 typedef typename std::__promote<_A1, _A2>::type type;
633 return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
642 template <class _A1, class _A2>
643 _LIBCPP_ALWAYS_INLINE
645 __libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
647 return islessequal(__lcpp_x, __lcpp_y);
652 template <class _A1, class _A2>
653 inline _LIBCPP_INLINE_VISIBILITY
654 typename std::enable_if
656 std::is_arithmetic<_A1>::value &&
657 std::is_arithmetic<_A2>::value,
660 islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
662 typedef typename std::__promote<_A1, _A2>::type type;
663 return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
666 #endif // islessequal
672 template <class _A1, class _A2>
673 _LIBCPP_ALWAYS_INLINE
675 __libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
677 return islessgreater(__lcpp_x, __lcpp_y);
682 template <class _A1, class _A2>
683 inline _LIBCPP_INLINE_VISIBILITY
684 typename std::enable_if
686 std::is_arithmetic<_A1>::value &&
687 std::is_arithmetic<_A2>::value,
690 islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
692 typedef typename std::__promote<_A1, _A2>::type type;
693 return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
696 #endif // islessgreater
702 template <class _A1, class _A2>
703 _LIBCPP_ALWAYS_INLINE
705 __libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
707 return isunordered(__lcpp_x, __lcpp_y);
712 template <class _A1, class _A2>
713 inline _LIBCPP_INLINE_VISIBILITY
714 typename std::enable_if
716 std::is_arithmetic<_A1>::value &&
717 std::is_arithmetic<_A2>::value,
720 isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
722 typedef typename std::__promote<_A1, _A2>::type type;
723 return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
726 #endif // isunordered
730 #if !(defined(_AIX) || defined(__sun__))
731 inline _LIBCPP_INLINE_VISIBILITY
733 abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
735 inline _LIBCPP_INLINE_VISIBILITY
737 abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);}
739 inline _LIBCPP_INLINE_VISIBILITY
741 abs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
742 #endif // !(defined(_AIX) || defined(__sun__))
746 #if !(defined(_AIX) || defined(__sun__))
747 inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return ::acosf(__lcpp_x);}
748 inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
752 inline _LIBCPP_INLINE_VISIBILITY
753 typename std::enable_if<std::is_integral<_A1>::value, double>::type
754 acos(_A1 __lcpp_x) _NOEXCEPT {return ::acos((double)__lcpp_x);}
758 #if !(defined(_AIX) || defined(__sun__))
759 inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return ::asinf(__lcpp_x);}
760 inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);}
764 inline _LIBCPP_INLINE_VISIBILITY
765 typename std::enable_if<std::is_integral<_A1>::value, double>::type
766 asin(_A1 __lcpp_x) _NOEXCEPT {return ::asin((double)__lcpp_x);}
770 #if !(defined(_AIX) || defined(__sun__))
771 inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return ::atanf(__lcpp_x);}
772 inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);}
776 inline _LIBCPP_INLINE_VISIBILITY
777 typename std::enable_if<std::is_integral<_A1>::value, double>::type
778 atan(_A1 __lcpp_x) _NOEXCEPT {return ::atan((double)__lcpp_x);}
782 #if !(defined(_AIX) || defined(__sun__))
783 inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return ::atan2f(__lcpp_y, __lcpp_x);}
784 inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);}
787 template <class _A1, class _A2>
788 inline _LIBCPP_INLINE_VISIBILITY
789 typename std::__lazy_enable_if
791 std::is_arithmetic<_A1>::value &&
792 std::is_arithmetic<_A2>::value,
793 std::__promote<_A1, _A2>
795 atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
797 typedef typename std::__promote<_A1, _A2>::type __result_type;
798 static_assert((!(std::is_same<_A1, __result_type>::value &&
799 std::is_same<_A2, __result_type>::value)), "");
800 return ::atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
805 #if !(defined(_AIX) || defined(__sun__))
806 inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ::ceilf(__lcpp_x);}
807 inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);}
811 inline _LIBCPP_INLINE_VISIBILITY
812 typename std::enable_if<std::is_integral<_A1>::value, double>::type
813 ceil(_A1 __lcpp_x) _NOEXCEPT {return ::ceil((double)__lcpp_x);}
817 #if !(defined(_AIX) || defined(__sun__))
818 inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return ::cosf(__lcpp_x);}
819 inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);}
823 inline _LIBCPP_INLINE_VISIBILITY
824 typename std::enable_if<std::is_integral<_A1>::value, double>::type
825 cos(_A1 __lcpp_x) _NOEXCEPT {return ::cos((double)__lcpp_x);}
829 #if !(defined(_AIX) || defined(__sun__))
830 inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return ::coshf(__lcpp_x);}
831 inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);}
835 inline _LIBCPP_INLINE_VISIBILITY
836 typename std::enable_if<std::is_integral<_A1>::value, double>::type
837 cosh(_A1 __lcpp_x) _NOEXCEPT {return ::cosh((double)__lcpp_x);}
841 #if !(defined(_AIX) || defined(__sun__))
842 inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return ::expf(__lcpp_x);}
843 inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);}
847 inline _LIBCPP_INLINE_VISIBILITY
848 typename std::enable_if<std::is_integral<_A1>::value, double>::type
849 exp(_A1 __lcpp_x) _NOEXCEPT {return ::exp((double)__lcpp_x);}
853 #if !(defined(_AIX) || defined(__sun__))
854 inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);}
855 inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
859 inline _LIBCPP_INLINE_VISIBILITY
860 typename std::enable_if<std::is_integral<_A1>::value, double>::type
861 fabs(_A1 __lcpp_x) _NOEXCEPT {return ::fabs((double)__lcpp_x);}
865 #if !(defined(_AIX) || defined(__sun__))
866 inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return ::floorf(__lcpp_x);}
867 inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);}
871 inline _LIBCPP_INLINE_VISIBILITY
872 typename std::enable_if<std::is_integral<_A1>::value, double>::type
873 floor(_A1 __lcpp_x) _NOEXCEPT {return ::floor((double)__lcpp_x);}
877 #if !(defined(_AIX) || defined(__sun__))
878 inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmodf(__lcpp_x, __lcpp_y);}
879 inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);}
882 template <class _A1, class _A2>
883 inline _LIBCPP_INLINE_VISIBILITY
884 typename std::__lazy_enable_if
886 std::is_arithmetic<_A1>::value &&
887 std::is_arithmetic<_A2>::value,
888 std::__promote<_A1, _A2>
890 fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
892 typedef typename std::__promote<_A1, _A2>::type __result_type;
893 static_assert((!(std::is_same<_A1, __result_type>::value &&
894 std::is_same<_A2, __result_type>::value)), "");
895 return ::fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
900 #if !(defined(_AIX) || defined(__sun__))
901 inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpf(__lcpp_x, __lcpp_e);}
902 inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);}
906 inline _LIBCPP_INLINE_VISIBILITY
907 typename std::enable_if<std::is_integral<_A1>::value, double>::type
908 frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexp((double)__lcpp_x, __lcpp_e);}
912 #if !(defined(_AIX) || defined(__sun__))
913 inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpf(__lcpp_x, __lcpp_e);}
914 inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);}
918 inline _LIBCPP_INLINE_VISIBILITY
919 typename std::enable_if<std::is_integral<_A1>::value, double>::type
920 ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexp((double)__lcpp_x, __lcpp_e);}
924 #if !(defined(_AIX) || defined(__sun__))
925 inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return ::logf(__lcpp_x);}
926 inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);}
930 inline _LIBCPP_INLINE_VISIBILITY
931 typename std::enable_if<std::is_integral<_A1>::value, double>::type
932 log(_A1 __lcpp_x) _NOEXCEPT {return ::log((double)__lcpp_x);}
936 #if !(defined(_AIX) || defined(__sun__))
937 inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return ::log10f(__lcpp_x);}
938 inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);}
942 inline _LIBCPP_INLINE_VISIBILITY
943 typename std::enable_if<std::is_integral<_A1>::value, double>::type
944 log10(_A1 __lcpp_x) _NOEXCEPT {return ::log10((double)__lcpp_x);}
948 #if !(defined(_AIX) || defined(__sun__))
949 inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return ::modff(__lcpp_x, __lcpp_y);}
950 inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);}
955 #if !(defined(_AIX) || defined(__sun__))
956 inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::powf(__lcpp_x, __lcpp_y);}
957 inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);}
960 template <class _A1, class _A2>
961 inline _LIBCPP_INLINE_VISIBILITY
962 typename std::__lazy_enable_if
964 std::is_arithmetic<_A1>::value &&
965 std::is_arithmetic<_A2>::value,
966 std::__promote<_A1, _A2>
968 pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
970 typedef typename std::__promote<_A1, _A2>::type __result_type;
971 static_assert((!(std::is_same<_A1, __result_type>::value &&
972 std::is_same<_A2, __result_type>::value)), "");
973 return ::pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
978 #if !(defined(_AIX) || defined(__sun__))
979 inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return ::sinf(__lcpp_x);}
980 inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);}
984 inline _LIBCPP_INLINE_VISIBILITY
985 typename std::enable_if<std::is_integral<_A1>::value, double>::type
986 sin(_A1 __lcpp_x) _NOEXCEPT {return ::sin((double)__lcpp_x);}
990 #if !(defined(_AIX) || defined(__sun__))
991 inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return ::sinhf(__lcpp_x);}
992 inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);}
996 inline _LIBCPP_INLINE_VISIBILITY
997 typename std::enable_if<std::is_integral<_A1>::value, double>::type
998 sinh(_A1 __lcpp_x) _NOEXCEPT {return ::sinh((double)__lcpp_x);}
1002 #if !(defined(_AIX) || defined(__sun__))
1003 inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return ::sqrtf(__lcpp_x);}
1004 inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
1007 template <class _A1>
1008 inline _LIBCPP_INLINE_VISIBILITY
1009 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1010 sqrt(_A1 __lcpp_x) _NOEXCEPT {return ::sqrt((double)__lcpp_x);}
1014 #if !(defined(_AIX) || defined(__sun__))
1015 inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return ::tanf(__lcpp_x);}
1016 inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);}
1019 template <class _A1>
1020 inline _LIBCPP_INLINE_VISIBILITY
1021 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1022 tan(_A1 __lcpp_x) _NOEXCEPT {return ::tan((double)__lcpp_x);}
1026 #if !(defined(_AIX) || defined(__sun__))
1027 inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return ::tanhf(__lcpp_x);}
1028 inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);}
1031 template <class _A1>
1032 inline _LIBCPP_INLINE_VISIBILITY
1033 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1034 tanh(_A1 __lcpp_x) _NOEXCEPT {return ::tanh((double)__lcpp_x);}
1038 inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return ::acoshf(__lcpp_x);}
1039 inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);}
1041 template <class _A1>
1042 inline _LIBCPP_INLINE_VISIBILITY
1043 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1044 acosh(_A1 __lcpp_x) _NOEXCEPT {return ::acosh((double)__lcpp_x);}
1048 inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return ::asinhf(__lcpp_x);}
1049 inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);}
1051 template <class _A1>
1052 inline _LIBCPP_INLINE_VISIBILITY
1053 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1054 asinh(_A1 __lcpp_x) _NOEXCEPT {return ::asinh((double)__lcpp_x);}
1058 inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return ::atanhf(__lcpp_x);}
1059 inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);}
1061 template <class _A1>
1062 inline _LIBCPP_INLINE_VISIBILITY
1063 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1064 atanh(_A1 __lcpp_x) _NOEXCEPT {return ::atanh((double)__lcpp_x);}
1068 inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return ::cbrtf(__lcpp_x);}
1069 inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);}
1071 template <class _A1>
1072 inline _LIBCPP_INLINE_VISIBILITY
1073 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1074 cbrt(_A1 __lcpp_x) _NOEXCEPT {return ::cbrt((double)__lcpp_x);}
1078 inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x,
1079 float __lcpp_y) _NOEXCEPT {
1080 return ::copysignf(__lcpp_x, __lcpp_y);
1082 inline _LIBCPP_INLINE_VISIBILITY long double
1083 copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
1084 return ::copysignl(__lcpp_x, __lcpp_y);
1087 template <class _A1, class _A2>
1088 inline _LIBCPP_INLINE_VISIBILITY
1089 typename std::__lazy_enable_if
1091 std::is_arithmetic<_A1>::value &&
1092 std::is_arithmetic<_A2>::value,
1093 std::__promote<_A1, _A2>
1095 copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1097 typedef typename std::__promote<_A1, _A2>::type __result_type;
1098 static_assert((!(std::is_same<_A1, __result_type>::value &&
1099 std::is_same<_A2, __result_type>::value)), "");
1100 return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1105 inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return ::erff(__lcpp_x);}
1106 inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return ::erfl(__lcpp_x);}
1108 template <class _A1>
1109 inline _LIBCPP_INLINE_VISIBILITY
1110 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1111 erf(_A1 __lcpp_x) _NOEXCEPT {return ::erf((double)__lcpp_x);}
1115 inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return ::erfcf(__lcpp_x);}
1116 inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return ::erfcl(__lcpp_x);}
1118 template <class _A1>
1119 inline _LIBCPP_INLINE_VISIBILITY
1120 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1121 erfc(_A1 __lcpp_x) _NOEXCEPT {return ::erfc((double)__lcpp_x);}
1125 inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return ::exp2f(__lcpp_x);}
1126 inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return ::exp2l(__lcpp_x);}
1128 template <class _A1>
1129 inline _LIBCPP_INLINE_VISIBILITY
1130 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1131 exp2(_A1 __lcpp_x) _NOEXCEPT {return ::exp2((double)__lcpp_x);}
1135 inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return ::expm1f(__lcpp_x);}
1136 inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return ::expm1l(__lcpp_x);}
1138 template <class _A1>
1139 inline _LIBCPP_INLINE_VISIBILITY
1140 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1141 expm1(_A1 __lcpp_x) _NOEXCEPT {return ::expm1((double)__lcpp_x);}
1145 inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fdimf(__lcpp_x, __lcpp_y);}
1146 inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fdiml(__lcpp_x, __lcpp_y);}
1148 template <class _A1, class _A2>
1149 inline _LIBCPP_INLINE_VISIBILITY
1150 typename std::__lazy_enable_if
1152 std::is_arithmetic<_A1>::value &&
1153 std::is_arithmetic<_A2>::value,
1154 std::__promote<_A1, _A2>
1156 fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1158 typedef typename std::__promote<_A1, _A2>::type __result_type;
1159 static_assert((!(std::is_same<_A1, __result_type>::value &&
1160 std::is_same<_A2, __result_type>::value)), "");
1161 return ::fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1166 inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return ::fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
1167 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);}
1169 template <class _A1, class _A2, class _A3>
1170 inline _LIBCPP_INLINE_VISIBILITY
1171 typename std::__lazy_enable_if
1173 std::is_arithmetic<_A1>::value &&
1174 std::is_arithmetic<_A2>::value &&
1175 std::is_arithmetic<_A3>::value,
1176 std::__promote<_A1, _A2, _A3>
1178 fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
1180 typedef typename std::__promote<_A1, _A2, _A3>::type __result_type;
1181 static_assert((!(std::is_same<_A1, __result_type>::value &&
1182 std::is_same<_A2, __result_type>::value &&
1183 std::is_same<_A3, __result_type>::value)), "");
1184 return ::fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
1189 inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fmaxf(__lcpp_x, __lcpp_y);}
1190 inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmaxl(__lcpp_x, __lcpp_y);}
1192 template <class _A1, class _A2>
1193 inline _LIBCPP_INLINE_VISIBILITY
1194 typename std::__lazy_enable_if
1196 std::is_arithmetic<_A1>::value &&
1197 std::is_arithmetic<_A2>::value,
1198 std::__promote<_A1, _A2>
1200 fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1202 typedef typename std::__promote<_A1, _A2>::type __result_type;
1203 static_assert((!(std::is_same<_A1, __result_type>::value &&
1204 std::is_same<_A2, __result_type>::value)), "");
1205 return ::fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1210 inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::fminf(__lcpp_x, __lcpp_y);}
1211 inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fminl(__lcpp_x, __lcpp_y);}
1213 template <class _A1, class _A2>
1214 inline _LIBCPP_INLINE_VISIBILITY
1215 typename std::__lazy_enable_if
1217 std::is_arithmetic<_A1>::value &&
1218 std::is_arithmetic<_A2>::value,
1219 std::__promote<_A1, _A2>
1221 fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1223 typedef typename std::__promote<_A1, _A2>::type __result_type;
1224 static_assert((!(std::is_same<_A1, __result_type>::value &&
1225 std::is_same<_A2, __result_type>::value)), "");
1226 return ::fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1231 inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::hypotf(__lcpp_x, __lcpp_y);}
1232 inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::hypotl(__lcpp_x, __lcpp_y);}
1234 template <class _A1, class _A2>
1235 inline _LIBCPP_INLINE_VISIBILITY
1236 typename std::__lazy_enable_if
1238 std::is_arithmetic<_A1>::value &&
1239 std::is_arithmetic<_A2>::value,
1240 std::__promote<_A1, _A2>
1242 hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1244 typedef typename std::__promote<_A1, _A2>::type __result_type;
1245 static_assert((!(std::is_same<_A1, __result_type>::value &&
1246 std::is_same<_A2, __result_type>::value)), "");
1247 return ::hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1252 inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ::ilogbf(__lcpp_x);}
1253 inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ::ilogbl(__lcpp_x);}
1255 template <class _A1>
1256 inline _LIBCPP_INLINE_VISIBILITY
1257 typename std::enable_if<std::is_integral<_A1>::value, int>::type
1258 ilogb(_A1 __lcpp_x) _NOEXCEPT {return ::ilogb((double)__lcpp_x);}
1262 inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return ::lgammaf(__lcpp_x);}
1263 inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return ::lgammal(__lcpp_x);}
1265 template <class _A1>
1266 inline _LIBCPP_INLINE_VISIBILITY
1267 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1268 lgamma(_A1 __lcpp_x) _NOEXCEPT {return ::lgamma((double)__lcpp_x);}
1272 inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return ::llrintf(__lcpp_x);}
1273 inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return ::llrintl(__lcpp_x);}
1275 template <class _A1>
1276 inline _LIBCPP_INLINE_VISIBILITY
1277 typename std::enable_if<std::is_integral<_A1>::value, long long>::type
1278 llrint(_A1 __lcpp_x) _NOEXCEPT {return ::llrint((double)__lcpp_x);}
1282 inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return ::llroundf(__lcpp_x);}
1283 inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return ::llroundl(__lcpp_x);}
1285 template <class _A1>
1286 inline _LIBCPP_INLINE_VISIBILITY
1287 typename std::enable_if<std::is_integral<_A1>::value, long long>::type
1288 llround(_A1 __lcpp_x) _NOEXCEPT {return ::llround((double)__lcpp_x);}
1292 inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return ::log1pf(__lcpp_x);}
1293 inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return ::log1pl(__lcpp_x);}
1295 template <class _A1>
1296 inline _LIBCPP_INLINE_VISIBILITY
1297 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1298 log1p(_A1 __lcpp_x) _NOEXCEPT {return ::log1p((double)__lcpp_x);}
1302 inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return ::log2f(__lcpp_x);}
1303 inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return ::log2l(__lcpp_x);}
1305 template <class _A1>
1306 inline _LIBCPP_INLINE_VISIBILITY
1307 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1308 log2(_A1 __lcpp_x) _NOEXCEPT {return ::log2((double)__lcpp_x);}
1312 inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return ::logbf(__lcpp_x);}
1313 inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return ::logbl(__lcpp_x);}
1315 template <class _A1>
1316 inline _LIBCPP_INLINE_VISIBILITY
1317 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1318 logb(_A1 __lcpp_x) _NOEXCEPT {return ::logb((double)__lcpp_x);}
1322 inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return ::lrintf(__lcpp_x);}
1323 inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return ::lrintl(__lcpp_x);}
1325 template <class _A1>
1326 inline _LIBCPP_INLINE_VISIBILITY
1327 typename std::enable_if<std::is_integral<_A1>::value, long>::type
1328 lrint(_A1 __lcpp_x) _NOEXCEPT {return ::lrint((double)__lcpp_x);}
1332 inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return ::lroundf(__lcpp_x);}
1333 inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return ::lroundl(__lcpp_x);}
1335 template <class _A1>
1336 inline _LIBCPP_INLINE_VISIBILITY
1337 typename std::enable_if<std::is_integral<_A1>::value, long>::type
1338 lround(_A1 __lcpp_x) _NOEXCEPT {return ::lround((double)__lcpp_x);}
1344 inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return ::nearbyintf(__lcpp_x);}
1345 inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return ::nearbyintl(__lcpp_x);}
1347 template <class _A1>
1348 inline _LIBCPP_INLINE_VISIBILITY
1349 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1350 nearbyint(_A1 __lcpp_x) _NOEXCEPT {return ::nearbyint((double)__lcpp_x);}
1354 inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::nextafterf(__lcpp_x, __lcpp_y);}
1355 inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nextafterl(__lcpp_x, __lcpp_y);}
1357 template <class _A1, class _A2>
1358 inline _LIBCPP_INLINE_VISIBILITY
1359 typename std::__lazy_enable_if
1361 std::is_arithmetic<_A1>::value &&
1362 std::is_arithmetic<_A2>::value,
1363 std::__promote<_A1, _A2>
1365 nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1367 typedef typename std::__promote<_A1, _A2>::type __result_type;
1368 static_assert((!(std::is_same<_A1, __result_type>::value &&
1369 std::is_same<_A2, __result_type>::value)), "");
1370 return ::nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1375 inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardf(__lcpp_x, __lcpp_y);}
1376 inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttowardl(__lcpp_x, __lcpp_y);}
1378 template <class _A1>
1379 inline _LIBCPP_INLINE_VISIBILITY
1380 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1381 nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::nexttoward((double)__lcpp_x, __lcpp_y);}
1385 inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return ::remainderf(__lcpp_x, __lcpp_y);}
1386 inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::remainderl(__lcpp_x, __lcpp_y);}
1388 template <class _A1, class _A2>
1389 inline _LIBCPP_INLINE_VISIBILITY
1390 typename std::__lazy_enable_if
1392 std::is_arithmetic<_A1>::value &&
1393 std::is_arithmetic<_A2>::value,
1394 std::__promote<_A1, _A2>
1396 remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1398 typedef typename std::__promote<_A1, _A2>::type __result_type;
1399 static_assert((!(std::is_same<_A1, __result_type>::value &&
1400 std::is_same<_A2, __result_type>::value)), "");
1401 return ::remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1406 inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return ::remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
1407 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);}
1409 template <class _A1, class _A2>
1410 inline _LIBCPP_INLINE_VISIBILITY
1411 typename std::__lazy_enable_if
1413 std::is_arithmetic<_A1>::value &&
1414 std::is_arithmetic<_A2>::value,
1415 std::__promote<_A1, _A2>
1417 remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
1419 typedef typename std::__promote<_A1, _A2>::type __result_type;
1420 static_assert((!(std::is_same<_A1, __result_type>::value &&
1421 std::is_same<_A2, __result_type>::value)), "");
1422 return ::remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
1427 inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return ::rintf(__lcpp_x);}
1428 inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return ::rintl(__lcpp_x);}
1430 template <class _A1>
1431 inline _LIBCPP_INLINE_VISIBILITY
1432 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1433 rint(_A1 __lcpp_x) _NOEXCEPT {return ::rint((double)__lcpp_x);}
1437 inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return ::roundf(__lcpp_x);}
1438 inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return ::roundl(__lcpp_x);}
1440 template <class _A1>
1441 inline _LIBCPP_INLINE_VISIBILITY
1442 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1443 round(_A1 __lcpp_x) _NOEXCEPT {return ::round((double)__lcpp_x);}
1447 inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnf(__lcpp_x, __lcpp_y);}
1448 inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalblnl(__lcpp_x, __lcpp_y);}
1450 template <class _A1>
1451 inline _LIBCPP_INLINE_VISIBILITY
1452 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1453 scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return ::scalbln((double)__lcpp_x, __lcpp_y);}
1457 inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnf(__lcpp_x, __lcpp_y);}
1458 inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbnl(__lcpp_x, __lcpp_y);}
1460 template <class _A1>
1461 inline _LIBCPP_INLINE_VISIBILITY
1462 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1463 scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return ::scalbn((double)__lcpp_x, __lcpp_y);}
1467 inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return ::tgammaf(__lcpp_x);}
1468 inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return ::tgammal(__lcpp_x);}
1470 template <class _A1>
1471 inline _LIBCPP_INLINE_VISIBILITY
1472 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1473 tgamma(_A1 __lcpp_x) _NOEXCEPT {return ::tgamma((double)__lcpp_x);}
1477 inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return ::truncf(__lcpp_x);}
1478 inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return ::truncl(__lcpp_x);}
1480 template <class _A1>
1481 inline _LIBCPP_INLINE_VISIBILITY
1482 typename std::enable_if<std::is_integral<_A1>::value, double>::type
1483 trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);}
1487 #endif // __cplusplus
1489 #endif // _LIBCPP_MATH_H