blob: 026889f81e5bc4d90d5a50b7d7f372be592e0e99 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001// -*- C++ -*-
2//===---------------------------- cmath -----------------------------------===//
3//
Howard Hinnantf5256e12010-05-11 21:36:01 +00004// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00005//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00006// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00008//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_CMATH
12#define _LIBCPP_CMATH
13
14/*
15 cmath synopsis
16
17Macros:
18
19 HUGE_VAL
20 HUGE_VALF // C99
21 HUGE_VALL // C99
22 INFINITY // C99
23 NAN // C99
24 FP_INFINITE // C99
25 FP_NAN // C99
26 FP_NORMAL // C99
27 FP_SUBNORMAL // C99
28 FP_ZERO // C99
29 FP_FAST_FMA // C99
30 FP_FAST_FMAF // C99
31 FP_FAST_FMAL // C99
32 FP_ILOGB0 // C99
33 FP_ILOGBNAN // C99
34 MATH_ERRNO // C99
35 MATH_ERREXCEPT // C99
36 math_errhandling // C99
37
38namespace std
39{
40
41Types:
42
43 float_t // C99
44 double_t // C99
45
46// C90
47
48floating_point abs(floating_point x);
49
50floating_point acos (arithmetic x);
51float acosf(float x);
52long double acosl(long double x);
53
54floating_point asin (arithmetic x);
55float asinf(float x);
56long double asinl(long double x);
57
58floating_point atan (arithmetic x);
59float atanf(float x);
60long double atanl(long double x);
61
62floating_point atan2 (arithmetic y, arithmetic x);
63float atan2f(float y, float x);
64long double atan2l(long double y, long double x);
65
66floating_point ceil (arithmetic x);
67float ceilf(float x);
68long double ceill(long double x);
69
70floating_point cos (arithmetic x);
71float cosf(float x);
72long double cosl(long double x);
73
74floating_point cosh (arithmetic x);
75float coshf(float x);
76long double coshl(long double x);
77
78floating_point exp (arithmetic x);
79float expf(float x);
80long double expl(long double x);
81
82floating_point fabs (arithmetic x);
83float fabsf(float x);
84long double fabsl(long double x);
85
86floating_point floor (arithmetic x);
87float floorf(float x);
88long double floorl(long double x);
89
90floating_point fmod (arithmetic x, arithmetic y);
91float fmodf(float x, float y);
92long double fmodl(long double x, long double y);
93
94floating_point frexp (arithmetic value, int* exp);
95float frexpf(float value, int* exp);
96long double frexpl(long double value, int* exp);
97
98floating_point ldexp (arithmetic value, int exp);
99float ldexpf(float value, int exp);
100long double ldexpl(long double value, int exp);
101
102floating_point log (arithmetic x);
103float logf(float x);
104long double logl(long double x);
105
106floating_point log10 (arithmetic x);
107float log10f(float x);
108long double log10l(long double x);
109
110floating_point modf (floating_point value, floating_point* iptr);
111float modff(float value, float* iptr);
112long double modfl(long double value, long double* iptr);
113
114floating_point pow (arithmetic x, arithmetic y);
115float powf(float x, float y);
116long double powl(long double x, long double y);
117
118floating_point sin (arithmetic x);
119float sinf(float x);
120long double sinl(long double x);
121
122floating_point sinh (arithmetic x);
123float sinhf(float x);
124long double sinhl(long double x);
125
126floating_point sqrt (arithmetic x);
127float sqrtf(float x);
128long double sqrtl(long double x);
129
130floating_point tan (arithmetic x);
131float tanf(float x);
132long double tanl(long double x);
133
134floating_point tanh (arithmetic x);
135float tanhf(float x);
136long double tanhl(long double x);
137
138// C99
139
140bool signbit(floating_point x);
141
142int fpclassify(floating_point x);
143
Howard Hinnant324bb032010-08-22 00:02:43 +0000144bool isfinite(floating_point x);
145bool isinf(floating_point x);
146bool isnan(floating_point x);
147bool isnormal(floating_point x);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000148
Howard Hinnant324bb032010-08-22 00:02:43 +0000149bool isgreater(floating_point x, floating_point y);
150bool isgreaterequal(floating_point x, floating_point y);
151bool isless(floating_point x, floating_point y);
152bool islessequal(floating_point x, floating_point y);
153bool islessgreater(floating_point x, floating_point y);
154bool isunordered(floating_point x, floating_point y);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000155
156floating_point acosh (arithmetic x);
157float acoshf(float x);
158long double acoshl(long double x);
159
160floating_point asinh (arithmetic x);
161float asinhf(float x);
162long double asinhl(long double x);
163
164floating_point atanh (arithmetic x);
165float atanhf(float x);
166long double atanhl(long double x);
167
168floating_point cbrt (arithmetic x);
169float cbrtf(float x);
170long double cbrtl(long double x);
171
172floating_point copysign (arithmetic x, arithmetic y);
173float copysignf(float x, float y);
174long double copysignl(long double x, long double y);
175
176floating_point erf (arithmetic x);
177float erff(float x);
178long double erfl(long double x);
179
180floating_point erfc (arithmetic x);
181float erfcf(float x);
182long double erfcl(long double x);
183
184floating_point exp2 (arithmetic x);
185float exp2f(float x);
186long double exp2l(long double x);
187
188floating_point expm1 (arithmetic x);
189float expm1f(float x);
190long double expm1l(long double x);
191
192floating_point fdim (arithmetic x, arithmetic y);
193float fdimf(float x, float y);
194long double fdiml(long double x, long double y);
195
196floating_point fma (arithmetic x, arithmetic y, arithmetic z);
197float fmaf(float x, float y, float z);
198long double fmal(long double x, long double y, long double z);
199
200floating_point fmax (arithmetic x, arithmetic y);
201float fmaxf(float x, float y);
202long double fmaxl(long double x, long double y);
203
204floating_point fmin (arithmetic x, arithmetic y);
205float fminf(float x, float y);
206long double fminl(long double x, long double y);
207
208floating_point hypot (arithmetic x, arithmetic y);
209float hypotf(float x, float y);
210long double hypotl(long double x, long double y);
211
212int ilogb (arithmetic x);
213int ilogbf(float x);
214int ilogbl(long double x);
215
216floating_point lgamma (arithmetic x);
217float lgammaf(float x);
218long double lgammal(long double x);
219
220long long llrint (arithmetic x);
221long long llrintf(float x);
222long long llrintl(long double x);
223
224long long llround (arithmetic x);
225long long llroundf(float x);
226long long llroundl(long double x);
227
228floating_point log1p (arithmetic x);
229float log1pf(float x);
230long double log1pl(long double x);
231
232floating_point log2 (arithmetic x);
233float log2f(float x);
234long double log2l(long double x);
235
236floating_point logb (arithmetic x);
237float logbf(float x);
238long double logbl(long double x);
239
240long lrint (arithmetic x);
241long lrintf(float x);
242long lrintl(long double x);
243
244long lround (arithmetic x);
245long lroundf(float x);
246long lroundl(long double x);
247
248double nan (const char* str);
249float nanf(const char* str);
250long double nanl(const char* str);
251
252floating_point nearbyint (arithmetic x);
253float nearbyintf(float x);
254long double nearbyintl(long double x);
255
256floating_point nextafter (arithmetic x, arithmetic y);
257float nextafterf(float x, float y);
258long double nextafterl(long double x, long double y);
259
260floating_point nexttoward (arithmetic x, long double y);
261float nexttowardf(float x, long double y);
262long double nexttowardl(long double x, long double y);
263
264floating_point remainder (arithmetic x, arithmetic y);
265float remainderf(float x, float y);
266long double remainderl(long double x, long double y);
267
268floating_point remquo (arithmetic x, arithmetic y, int* pquo);
269float remquof(float x, float y, int* pquo);
270long double remquol(long double x, long double y, int* pquo);
271
272floating_point rint (arithmetic x);
273float rintf(float x);
274long double rintl(long double x);
275
276floating_point round (arithmetic x);
277float roundf(float x);
278long double roundl(long double x);
279
280floating_point scalbln (arithmetic x, long ex);
281float scalblnf(float x, long ex);
282long double scalblnl(long double x, long ex);
283
284floating_point scalbn (arithmetic x, int ex);
285float scalbnf(float x, int ex);
286long double scalbnl(long double x, int ex);
287
288floating_point tgamma (arithmetic x);
289float tgammaf(float x);
290long double tgammal(long double x);
291
292floating_point trunc (arithmetic x);
293float truncf(float x);
294long double truncl(long double x);
295
296} // std
297
298*/
299
300#include <__config>
301#include <math.h>
302#include <type_traits>
303
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000304#ifdef _MSC_VER
305#include "support/win32/math_win32.h"
306#endif
307
Howard Hinnant08e17472011-10-17 20:05:10 +0000308#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000309#pragma GCC system_header
Howard Hinnant08e17472011-10-17 20:05:10 +0000310#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000311
Howard Hinnant0a111112011-05-13 21:52:40 +0000312// signbit
313
314#ifdef signbit
315
316template <class _A1>
317_LIBCPP_ALWAYS_INLINE
318bool
319__libcpp_signbit(_A1 __x)
320{
321 return signbit(__x);
322}
323
324#undef signbit
325
326template <class _A1>
327inline _LIBCPP_INLINE_VISIBILITY
328typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
329signbit(_A1 __x)
330{
331 return __libcpp_signbit(__x);
332}
333
334#endif // signbit
335
336// fpclassify
337
338#ifdef fpclassify
339
340template <class _A1>
341_LIBCPP_ALWAYS_INLINE
342int
343__libcpp_fpclassify(_A1 __x)
344{
345 return fpclassify(__x);
346}
347
348#undef fpclassify
349
350template <class _A1>
351inline _LIBCPP_INLINE_VISIBILITY
352typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
353fpclassify(_A1 __x)
354{
355 return __libcpp_fpclassify(__x);
356}
357
358#endif // fpclassify
359
360// isfinite
361
362#ifdef isfinite
363
364template <class _A1>
365_LIBCPP_ALWAYS_INLINE
366bool
367__libcpp_isfinite(_A1 __x)
368{
369 return isfinite(__x);
370}
371
372#undef isfinite
373
374template <class _A1>
375inline _LIBCPP_INLINE_VISIBILITY
376typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
377isfinite(_A1 __x)
378{
379 return __libcpp_isfinite(__x);
380}
381
382#endif // isfinite
383
384// isinf
385
386#ifdef isinf
387
388template <class _A1>
389_LIBCPP_ALWAYS_INLINE
390bool
391__libcpp_isinf(_A1 __x)
392{
393 return isinf(__x);
394}
395
396#undef isinf
397
398template <class _A1>
399inline _LIBCPP_INLINE_VISIBILITY
400typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
401isinf(_A1 __x)
402{
403 return __libcpp_isinf(__x);
404}
405
406#endif // isinf
407
408// isnan
409
410#ifdef isnan
411
412template <class _A1>
413_LIBCPP_ALWAYS_INLINE
414bool
415__libcpp_isnan(_A1 __x)
416{
417 return isnan(__x);
418}
419
420#undef isnan
421
422template <class _A1>
423inline _LIBCPP_INLINE_VISIBILITY
424typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
425isnan(_A1 __x)
426{
427 return __libcpp_isnan(__x);
428}
429
430#endif // isnan
431
432// isnormal
433
434#ifdef isnormal
435
436template <class _A1>
437_LIBCPP_ALWAYS_INLINE
438bool
439__libcpp_isnormal(_A1 __x)
440{
441 return isnormal(__x);
442}
443
444#undef isnormal
445
446template <class _A1>
447inline _LIBCPP_INLINE_VISIBILITY
448typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
449isnormal(_A1 __x)
450{
451 return __libcpp_isnormal(__x);
452}
453
454#endif // isnormal
455
456// isgreater
457
458#ifdef isgreater
459
460template <class _A1, class _A2>
461_LIBCPP_ALWAYS_INLINE
462bool
463__libcpp_isgreater(_A1 __x, _A2 __y)
464{
465 return isgreater(__x, __y);
466}
467
468#undef isgreater
469
470template <class _A1, class _A2>
471inline _LIBCPP_INLINE_VISIBILITY
472typename std::enable_if
473<
474 std::is_floating_point<_A1>::value &&
475 std::is_floating_point<_A2>::value,
476 bool
477>::type
478isgreater(_A1 __x, _A2 __y)
479{
480 return __libcpp_isgreater(__x, __y);
481}
482
483#endif // isgreater
484
485// isgreaterequal
486
487#ifdef isgreaterequal
488
489template <class _A1, class _A2>
490_LIBCPP_ALWAYS_INLINE
491bool
492__libcpp_isgreaterequal(_A1 __x, _A2 __y)
493{
494 return isgreaterequal(__x, __y);
495}
496
497#undef isgreaterequal
498
499template <class _A1, class _A2>
500inline _LIBCPP_INLINE_VISIBILITY
501typename std::enable_if
502<
503 std::is_floating_point<_A1>::value &&
504 std::is_floating_point<_A2>::value,
505 bool
506>::type
507isgreaterequal(_A1 __x, _A2 __y)
508{
509 return __libcpp_isgreaterequal(__x, __y);
510}
511
512#endif // isgreaterequal
513
514// isless
515
516#ifdef isless
517
518template <class _A1, class _A2>
519_LIBCPP_ALWAYS_INLINE
520bool
521__libcpp_isless(_A1 __x, _A2 __y)
522{
523 return isless(__x, __y);
524}
525
526#undef isless
527
528template <class _A1, class _A2>
529inline _LIBCPP_INLINE_VISIBILITY
530typename std::enable_if
531<
532 std::is_floating_point<_A1>::value &&
533 std::is_floating_point<_A2>::value,
534 bool
535>::type
536isless(_A1 __x, _A2 __y)
537{
538 return __libcpp_isless(__x, __y);
539}
540
541#endif // isless
542
543// islessequal
544
545#ifdef islessequal
546
547template <class _A1, class _A2>
548_LIBCPP_ALWAYS_INLINE
549bool
550__libcpp_islessequal(_A1 __x, _A2 __y)
551{
552 return islessequal(__x, __y);
553}
554
555#undef islessequal
556
557template <class _A1, class _A2>
558inline _LIBCPP_INLINE_VISIBILITY
559typename std::enable_if
560<
561 std::is_floating_point<_A1>::value &&
562 std::is_floating_point<_A2>::value,
563 bool
564>::type
565islessequal(_A1 __x, _A2 __y)
566{
567 return __libcpp_islessequal(__x, __y);
568}
569
570#endif // islessequal
571
572// islessgreater
573
574#ifdef islessgreater
575
576template <class _A1, class _A2>
577_LIBCPP_ALWAYS_INLINE
578bool
579__libcpp_islessgreater(_A1 __x, _A2 __y)
580{
581 return islessgreater(__x, __y);
582}
583
584#undef islessgreater
585
586template <class _A1, class _A2>
587inline _LIBCPP_INLINE_VISIBILITY
588typename std::enable_if
589<
590 std::is_floating_point<_A1>::value &&
591 std::is_floating_point<_A2>::value,
592 bool
593>::type
594islessgreater(_A1 __x, _A2 __y)
595{
596 return __libcpp_islessgreater(__x, __y);
597}
598
599#endif // islessgreater
600
601// isunordered
602
603#ifdef isunordered
604
605template <class _A1, class _A2>
606_LIBCPP_ALWAYS_INLINE
607bool
608__libcpp_isunordered(_A1 __x, _A2 __y)
609{
610 return isunordered(__x, __y);
611}
612
613#undef isunordered
614
615template <class _A1, class _A2>
616inline _LIBCPP_INLINE_VISIBILITY
617typename std::enable_if
618<
619 std::is_floating_point<_A1>::value &&
620 std::is_floating_point<_A2>::value,
621 bool
622>::type
623isunordered(_A1 __x, _A2 __y)
624{
625 return __libcpp_isunordered(__x, __y);
626}
627
628#endif // isunordered
629
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000630_LIBCPP_BEGIN_NAMESPACE_STD
631
Howard Hinnant0a111112011-05-13 21:52:40 +0000632using ::signbit;
633using ::fpclassify;
634using ::isfinite;
635using ::isinf;
636using ::isnan;
637using ::isnormal;
638using ::isgreater;
639using ::isgreaterequal;
640using ::isless;
641using ::islessequal;
642using ::islessgreater;
643using ::isunordered;
644using ::isunordered;
645
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000646using ::float_t;
647using ::double_t;
648
649// abs
650
651template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000652inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000653typename enable_if<is_floating_point<_A1>::value, _A1>::type
654abs(_A1 __x) {return fabs(__x);}
655
David Chisnall997e4542012-02-29 13:05:08 +0000656#ifndef __sun__
657
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000658// acos
659
660using ::acos;
661using ::acosf;
662
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000663#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000664inline _LIBCPP_INLINE_VISIBILITY float acos(float __x) {return acosf(__x);}
665inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) {return acosl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000666#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000667
668template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000669inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000670typename enable_if<is_integral<_A1>::value, double>::type
671acos(_A1 __x) {return acos((double)__x);}
672
673// asin
674
675using ::asin;
676using ::asinf;
677
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000678#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000679inline _LIBCPP_INLINE_VISIBILITY float asin(float __x) {return asinf(__x);}
680inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) {return asinl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000681#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000682
683template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000684inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000685typename enable_if<is_integral<_A1>::value, double>::type
686asin(_A1 __x) {return asin((double)__x);}
687
688// atan
689
690using ::atan;
691using ::atanf;
692
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000693#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000694inline _LIBCPP_INLINE_VISIBILITY float atan(float __x) {return atanf(__x);}
695inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) {return atanl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000696#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000697
698template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000699inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000700typename enable_if<is_integral<_A1>::value, double>::type
701atan(_A1 __x) {return atan((double)__x);}
702
703// atan2
704
705using ::atan2;
706using ::atan2f;
707
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000708#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000709inline _LIBCPP_INLINE_VISIBILITY float atan2(float __y, float __x) {return atan2f(__y, __x);}
710inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) {return atan2l(__y, __x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000711#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000712
713template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000714inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000715typename enable_if
716<
717 is_arithmetic<_A1>::value &&
718 is_arithmetic<_A2>::value,
719 typename __promote<_A1, _A2>::type
720>::type
721atan2(_A1 __y, _A2 __x)
722{
723 typedef typename __promote<_A1, _A2>::type __result_type;
724 static_assert((!(is_same<_A1, __result_type>::value &&
725 is_same<_A2, __result_type>::value)), "");
726 return atan2((__result_type)__y, (__result_type)__x);
727}
728
729// ceil
730
731using ::ceil;
732using ::ceilf;
733
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000734#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000735inline _LIBCPP_INLINE_VISIBILITY float ceil(float __x) {return ceilf(__x);}
736inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) {return ceill(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000737#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000738
739template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000740inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000741typename enable_if<is_integral<_A1>::value, double>::type
742ceil(_A1 __x) {return ceil((double)__x);}
743
744// cos
745
746using ::cos;
747using ::cosf;
748
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000749#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000750inline _LIBCPP_INLINE_VISIBILITY float cos(float __x) {return cosf(__x);}
751inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) {return cosl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000752#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000753
754template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000755inline _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000756typename enable_if<is_integral<_A1>::value, double>::type
757cos(_A1 __x) {return cos((double)__x);}
758
759// cosh
760
761using ::cosh;
762using ::coshf;
763
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000764#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000765inline _LIBCPP_INLINE_VISIBILITY float cosh(float __x) {return coshf(__x);}
766inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) {return coshl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000767#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000768
769template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000770inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000771typename enable_if<is_integral<_A1>::value, double>::type
772cosh(_A1 __x) {return cosh((double)__x);}
773
David Chisnall997e4542012-02-29 13:05:08 +0000774#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000775// exp
776
777using ::exp;
778using ::expf;
779
David Chisnall997e4542012-02-29 13:05:08 +0000780#ifndef __sun__
781
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000782#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000783inline _LIBCPP_INLINE_VISIBILITY float exp(float __x) {return expf(__x);}
784inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) {return expl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000785#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000786
David Chisnall997e4542012-02-29 13:05:08 +0000787
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000788template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000789inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000790typename enable_if<is_integral<_A1>::value, double>::type
791exp(_A1 __x) {return exp((double)__x);}
792
793// fabs
794
795using ::fabs;
796using ::fabsf;
797
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000798#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000799inline _LIBCPP_INLINE_VISIBILITY float fabs(float __x) {return fabsf(__x);}
800inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) {return fabsl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000801#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000802
803template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000804inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000805typename enable_if<is_integral<_A1>::value, double>::type
806fabs(_A1 __x) {return fabs((double)__x);}
807
808// floor
809
810using ::floor;
811using ::floorf;
812
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000813#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000814inline _LIBCPP_INLINE_VISIBILITY float floor(float __x) {return floorf(__x);}
815inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) {return floorl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000816#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000817
818template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000819inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000820typename enable_if<is_integral<_A1>::value, double>::type
821floor(_A1 __x) {return floor((double)__x);}
822
823// fmod
824
David Chisnall997e4542012-02-29 13:05:08 +0000825#endif //__sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000826using ::fmod;
827using ::fmodf;
David Chisnall997e4542012-02-29 13:05:08 +0000828#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000829
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000830#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000831inline _LIBCPP_INLINE_VISIBILITY float fmod(float __x, float __y) {return fmodf(__x, __y);}
832inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) {return fmodl(__x, __y);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000833#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000834
835template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000836inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000837typename enable_if
838<
839 is_arithmetic<_A1>::value &&
840 is_arithmetic<_A2>::value,
841 typename __promote<_A1, _A2>::type
842>::type
843fmod(_A1 __x, _A2 __y)
844{
845 typedef typename __promote<_A1, _A2>::type __result_type;
846 static_assert((!(is_same<_A1, __result_type>::value &&
847 is_same<_A2, __result_type>::value)), "");
848 return fmod((__result_type)__x, (__result_type)__y);
849}
850
David Chisnall997e4542012-02-29 13:05:08 +0000851
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000852// frexp
853
854using ::frexp;
855using ::frexpf;
856
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000857#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000858inline _LIBCPP_INLINE_VISIBILITY float frexp(float __x, int* __e) {return frexpf(__x, __e);}
859inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) {return frexpl(__x, __e);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000860#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000861
862template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000863inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000864typename enable_if<is_integral<_A1>::value, double>::type
865frexp(_A1 __x, int* __e) {return frexp((double)__x, __e);}
866
867// ldexp
868
869using ::ldexp;
870using ::ldexpf;
871
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000872#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000873inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __x, int __e) {return ldexpf(__x, __e);}
874inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) {return ldexpl(__x, __e);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000875#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000876
877template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000878inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000879typename enable_if<is_integral<_A1>::value, double>::type
880ldexp(_A1 __x, int __e) {return ldexp((double)__x, __e);}
881
882// log
883
David Chisnall997e4542012-02-29 13:05:08 +0000884#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000885using ::log;
886using ::logf;
David Chisnall997e4542012-02-29 13:05:08 +0000887#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000888
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000889#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000890inline _LIBCPP_INLINE_VISIBILITY float log(float __x) {return logf(__x);}
891inline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) {return logl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000892#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000893
894template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000895inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000896typename enable_if<is_integral<_A1>::value, double>::type
897log(_A1 __x) {return log((double)__x);}
898
David Chisnall997e4542012-02-29 13:05:08 +0000899
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000900// log10
901
902using ::log10;
903using ::log10f;
904
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000905#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000906inline _LIBCPP_INLINE_VISIBILITY float log10(float __x) {return log10f(__x);}
907inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) {return log10l(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000908#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000909
910template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000911inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000912typename enable_if<is_integral<_A1>::value, double>::type
913log10(_A1 __x) {return log10((double)__x);}
914
915// modf
916
917using ::modf;
918using ::modff;
919
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000920#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000921inline _LIBCPP_INLINE_VISIBILITY float modf(float __x, float* __y) {return modff(__x, __y);}
922inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) {return modfl(__x, __y);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000923#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000924
925// pow
926
David Chisnall997e4542012-02-29 13:05:08 +0000927#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000928using ::pow;
929using ::powf;
930
David Chisnall997e4542012-02-29 13:05:08 +0000931#ifndef __sun__
932
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000933#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000934inline _LIBCPP_INLINE_VISIBILITY float pow(float __x, float __y) {return powf(__x, __y);}
935inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) {return powl(__x, __y);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000936#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000937
938template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000939inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000940typename enable_if
941<
942 is_arithmetic<_A1>::value &&
943 is_arithmetic<_A2>::value,
944 typename __promote<_A1, _A2>::type
945>::type
946pow(_A1 __x, _A2 __y)
947{
948 typedef typename __promote<_A1, _A2>::type __result_type;
949 static_assert((!(is_same<_A1, __result_type>::value &&
950 is_same<_A2, __result_type>::value)), "");
951 return pow((__result_type)__x, (__result_type)__y);
952}
953
David Chisnall997e4542012-02-29 13:05:08 +0000954
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000955// sin
956
957using ::sin;
958using ::sinf;
959
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000960#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000961inline _LIBCPP_INLINE_VISIBILITY float sin(float __x) {return sinf(__x);}
962inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) {return sinl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000963#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000964
965template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000966inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000967typename enable_if<is_integral<_A1>::value, double>::type
968sin(_A1 __x) {return sin((double)__x);}
969
970// sinh
971
972using ::sinh;
973using ::sinhf;
974
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000975#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000976inline _LIBCPP_INLINE_VISIBILITY float sinh(float __x) {return sinhf(__x);}
977inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) {return sinhl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000978#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000979
980template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000981inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000982typename enable_if<is_integral<_A1>::value, double>::type
983sinh(_A1 __x) {return sinh((double)__x);}
984
985// sqrt
986
David Chisnall997e4542012-02-29 13:05:08 +0000987#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000988using ::sqrt;
989using ::sqrtf;
990
David Chisnall997e4542012-02-29 13:05:08 +0000991
992#if !(defined(_MSC_VER) || defined(__sun__))
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000993inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __x) {return sqrtf(__x);}
994inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) {return sqrtl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000995#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000996
997template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000998inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000999typename enable_if<is_integral<_A1>::value, double>::type
1000sqrt(_A1 __x) {return sqrt((double)__x);}
1001
1002// tan
1003
1004using ::tan;
1005using ::tanf;
David Chisnall997e4542012-02-29 13:05:08 +00001006#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001007
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001008#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001009inline _LIBCPP_INLINE_VISIBILITY float tan(float __x) {return tanf(__x);}
1010inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) {return tanl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001011#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001012
1013template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001014inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001015typename enable_if<is_integral<_A1>::value, double>::type
1016tan(_A1 __x) {return tan((double)__x);}
1017
1018// tanh
1019
1020using ::tanh;
1021using ::tanhf;
1022
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001023#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001024inline _LIBCPP_INLINE_VISIBILITY float tanh(float __x) {return tanhf(__x);}
1025inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) {return tanhl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001026#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001027
1028template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001029inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001030typename enable_if<is_integral<_A1>::value, double>::type
1031tanh(_A1 __x) {return tanh((double)__x);}
1032
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001033// acosh
1034
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001035#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001036using ::acosh;
1037using ::acoshf;
1038
1039inline _LIBCPP_INLINE_VISIBILITY float acosh(float __x) {return acoshf(__x);}
1040inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) {return acoshl(__x);}
1041
1042template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001043inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001044typename enable_if<is_integral<_A1>::value, double>::type
1045acosh(_A1 __x) {return acosh((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001046#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001047
1048// asinh
1049
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001050#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001051using ::asinh;
1052using ::asinhf;
1053
1054inline _LIBCPP_INLINE_VISIBILITY float asinh(float __x) {return asinhf(__x);}
1055inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) {return asinhl(__x);}
1056
1057template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001058inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001059typename enable_if<is_integral<_A1>::value, double>::type
1060asinh(_A1 __x) {return asinh((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001061#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001062
1063// atanh
1064
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001065#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001066using ::atanh;
1067using ::atanhf;
1068
1069inline _LIBCPP_INLINE_VISIBILITY float atanh(float __x) {return atanhf(__x);}
1070inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) {return atanhl(__x);}
1071
1072template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001073inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001074typename enable_if<is_integral<_A1>::value, double>::type
1075atanh(_A1 __x) {return atanh((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001076#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001077
1078// cbrt
1079
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001080#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001081using ::cbrt;
1082using ::cbrtf;
1083
1084inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __x) {return cbrtf(__x);}
1085inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) {return cbrtl(__x);}
1086
1087template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001088inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001089typename enable_if<is_integral<_A1>::value, double>::type
1090cbrt(_A1 __x) {return cbrt((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001091#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001092
1093// copysign
1094
1095using ::copysign;
1096using ::copysignf;
1097
1098inline _LIBCPP_INLINE_VISIBILITY float copysign(float __x, float __y) {return copysignf(__x, __y);}
1099inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) {return copysignl(__x, __y);}
1100
1101template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001102inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001103typename enable_if
1104<
1105 is_arithmetic<_A1>::value &&
1106 is_arithmetic<_A2>::value,
1107 typename __promote<_A1, _A2>::type
1108>::type
1109copysign(_A1 __x, _A2 __y)
1110{
1111 typedef typename __promote<_A1, _A2>::type __result_type;
1112 static_assert((!(is_same<_A1, __result_type>::value &&
1113 is_same<_A2, __result_type>::value)), "");
1114 return copysign((__result_type)__x, (__result_type)__y);
1115}
1116
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001117#ifndef _MSC_VER
1118
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001119// erf
1120
1121using ::erf;
1122using ::erff;
1123
1124inline _LIBCPP_INLINE_VISIBILITY float erf(float __x) {return erff(__x);}
1125inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) {return erfl(__x);}
1126
1127template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001128inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001129typename enable_if<is_integral<_A1>::value, double>::type
1130erf(_A1 __x) {return erf((double)__x);}
1131
1132// erfc
1133
1134using ::erfc;
1135using ::erfcf;
1136
1137inline _LIBCPP_INLINE_VISIBILITY float erfc(float __x) {return erfcf(__x);}
1138inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) {return erfcl(__x);}
1139
1140template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001141inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001142typename enable_if<is_integral<_A1>::value, double>::type
1143erfc(_A1 __x) {return erfc((double)__x);}
1144
1145// exp2
1146
1147using ::exp2;
1148using ::exp2f;
1149
1150inline _LIBCPP_INLINE_VISIBILITY float exp2(float __x) {return exp2f(__x);}
1151inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) {return exp2l(__x);}
1152
1153template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001154inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001155typename enable_if<is_integral<_A1>::value, double>::type
1156exp2(_A1 __x) {return exp2((double)__x);}
1157
1158// expm1
1159
1160using ::expm1;
1161using ::expm1f;
1162
1163inline _LIBCPP_INLINE_VISIBILITY float expm1(float __x) {return expm1f(__x);}
1164inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) {return expm1l(__x);}
1165
1166template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001167inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001168typename enable_if<is_integral<_A1>::value, double>::type
1169expm1(_A1 __x) {return expm1((double)__x);}
1170
1171// fdim
1172
1173using ::fdim;
1174using ::fdimf;
1175
1176inline _LIBCPP_INLINE_VISIBILITY float fdim(float __x, float __y) {return fdimf(__x, __y);}
1177inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) {return fdiml(__x, __y);}
1178
1179template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001180inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001181typename enable_if
1182<
1183 is_arithmetic<_A1>::value &&
1184 is_arithmetic<_A2>::value,
1185 typename __promote<_A1, _A2>::type
1186>::type
1187fdim(_A1 __x, _A2 __y)
1188{
1189 typedef typename __promote<_A1, _A2>::type __result_type;
1190 static_assert((!(is_same<_A1, __result_type>::value &&
1191 is_same<_A2, __result_type>::value)), "");
1192 return fdim((__result_type)__x, (__result_type)__y);
1193}
1194
1195// fma
1196
1197inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) {return (float)((double)__x*__y + __z);}
1198#define FP_FAST_FMAF
1199
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001200using ::fma;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001201
1202inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) {return fmaf(__x, __y, __z);}
1203inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) {return fmal(__x, __y, __z);}
1204
1205template <class _A1, class _A2, class _A3>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001206inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001207typename enable_if
1208<
1209 is_arithmetic<_A1>::value &&
1210 is_arithmetic<_A2>::value &&
1211 is_arithmetic<_A3>::value,
1212 typename __promote<_A1, _A2, _A3>::type
1213>::type
1214fma(_A1 __x, _A2 __y, _A3 __z)
1215{
1216 typedef typename __promote<_A1, _A2, _A3>::type __result_type;
1217 static_assert((!(is_same<_A1, __result_type>::value &&
1218 is_same<_A2, __result_type>::value &&
1219 is_same<_A3, __result_type>::value)), "");
1220 return fma((__result_type)__x, (__result_type)__y, (__result_type)__z);
1221}
1222
1223// fmax
1224
1225using ::fmax;
1226using ::fmaxf;
1227
1228inline _LIBCPP_INLINE_VISIBILITY float fmax(float __x, float __y) {return fmaxf(__x, __y);}
1229inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) {return fmaxl(__x, __y);}
1230
1231template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001232inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001233typename enable_if
1234<
1235 is_arithmetic<_A1>::value &&
1236 is_arithmetic<_A2>::value,
1237 typename __promote<_A1, _A2>::type
1238>::type
1239fmax(_A1 __x, _A2 __y)
1240{
1241 typedef typename __promote<_A1, _A2>::type __result_type;
1242 static_assert((!(is_same<_A1, __result_type>::value &&
1243 is_same<_A2, __result_type>::value)), "");
1244 return fmax((__result_type)__x, (__result_type)__y);
1245}
1246
1247// fmin
1248
1249using ::fmin;
1250using ::fminf;
1251
1252inline _LIBCPP_INLINE_VISIBILITY float fmin(float __x, float __y) {return fminf(__x, __y);}
1253inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) {return fminl(__x, __y);}
1254
1255template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001256inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001257typename enable_if
1258<
1259 is_arithmetic<_A1>::value &&
1260 is_arithmetic<_A2>::value,
1261 typename __promote<_A1, _A2>::type
1262>::type
1263fmin(_A1 __x, _A2 __y)
1264{
1265 typedef typename __promote<_A1, _A2>::type __result_type;
1266 static_assert((!(is_same<_A1, __result_type>::value &&
1267 is_same<_A2, __result_type>::value)), "");
1268 return fmin((__result_type)__x, (__result_type)__y);
1269}
1270
1271// hypot
1272
1273using ::hypot;
1274using ::hypotf;
1275
1276inline _LIBCPP_INLINE_VISIBILITY float hypot(float __x, float __y) {return hypotf(__x, __y);}
1277inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) {return hypotl(__x, __y);}
1278
1279template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001280inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001281typename enable_if
1282<
1283 is_arithmetic<_A1>::value &&
1284 is_arithmetic<_A2>::value,
1285 typename __promote<_A1, _A2>::type
1286>::type
1287hypot(_A1 __x, _A2 __y)
1288{
1289 typedef typename __promote<_A1, _A2>::type __result_type;
1290 static_assert((!(is_same<_A1, __result_type>::value &&
1291 is_same<_A2, __result_type>::value)), "");
1292 return hypot((__result_type)__x, (__result_type)__y);
1293}
1294
1295// ilogb
1296
1297using ::ilogb;
1298using ::ilogbf;
1299
1300inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x) {return ilogbf(__x);}
1301inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) {return ilogbl(__x);}
1302
1303template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001304inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001305typename enable_if<is_integral<_A1>::value, int>::type
1306ilogb(_A1 __x) {return ilogb((double)__x);}
1307
1308// lgamma
1309
1310using ::lgamma;
1311using ::lgammaf;
1312
1313inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __x) {return lgammaf(__x);}
1314inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) {return lgammal(__x);}
1315
David Chisnall997e4542012-02-29 13:05:08 +00001316
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001317template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001318inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001319typename enable_if<is_integral<_A1>::value, double>::type
1320lgamma(_A1 __x) {return lgamma((double)__x);}
1321
David Chisnall997e4542012-02-29 13:05:08 +00001322
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001323// llrint
1324
1325using ::llrint;
1326using ::llrintf;
1327
1328inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) {return llrintf(__x);}
1329inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) {return llrintl(__x);}
1330
1331template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001332inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001333typename enable_if<is_integral<_A1>::value, long long>::type
1334llrint(_A1 __x) {return llrint((double)__x);}
1335
1336// llround
1337
1338using ::llround;
1339using ::llroundf;
1340
1341inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) {return llroundf(__x);}
1342inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) {return llroundl(__x);}
1343
1344template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001345inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001346typename enable_if<is_integral<_A1>::value, long long>::type
1347llround(_A1 __x) {return llround((double)__x);}
1348
1349// log1p
1350
1351using ::log1p;
1352using ::log1pf;
1353
1354inline _LIBCPP_INLINE_VISIBILITY float log1p(float __x) {return log1pf(__x);}
1355inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) {return log1pl(__x);}
1356
1357template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001358inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001359typename enable_if<is_integral<_A1>::value, double>::type
1360log1p(_A1 __x) {return log1p((double)__x);}
1361
1362// log2
1363
1364using ::log2;
1365using ::log2f;
1366
1367inline _LIBCPP_INLINE_VISIBILITY float log2(float __x) {return log2f(__x);}
1368inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) {return log2l(__x);}
1369
1370template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001371inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001372typename enable_if<is_integral<_A1>::value, double>::type
1373log2(_A1 __x) {return log2((double)__x);}
1374
1375// logb
1376
1377using ::logb;
1378using ::logbf;
1379
1380inline _LIBCPP_INLINE_VISIBILITY float logb(float __x) {return logbf(__x);}
1381inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) {return logbl(__x);}
1382
1383template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001384inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001385typename enable_if<is_integral<_A1>::value, double>::type
1386logb(_A1 __x) {return logb((double)__x);}
1387
1388// lrint
1389
1390using ::lrint;
1391using ::lrintf;
1392
1393inline _LIBCPP_INLINE_VISIBILITY long lrint(float __x) {return lrintf(__x);}
1394inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) {return lrintl(__x);}
1395
1396template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001397inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001398typename enable_if<is_integral<_A1>::value, long>::type
1399lrint(_A1 __x) {return lrint((double)__x);}
1400
1401// lround
1402
1403using ::lround;
1404using ::lroundf;
1405
1406inline _LIBCPP_INLINE_VISIBILITY long lround(float __x) {return lroundf(__x);}
1407inline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) {return lroundl(__x);}
1408
1409template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001410inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001411typename enable_if<is_integral<_A1>::value, long>::type
1412lround(_A1 __x) {return lround((double)__x);}
1413
1414// nan
David Chisnallb6e7c302012-02-29 16:41:21 +00001415#endif // _MSC_VER
David Chisnall997e4542012-02-29 13:05:08 +00001416#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001417using ::nan;
1418using ::nanf;
David Chisnall997e4542012-02-29 13:05:08 +00001419#ifndef __sun__
David Chisnallb6e7c302012-02-29 16:41:21 +00001420#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001421
1422// nearbyint
1423
1424using ::nearbyint;
1425using ::nearbyintf;
1426
1427inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __x) {return nearbyintf(__x);}
1428inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) {return nearbyintl(__x);}
1429
1430template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001431inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001432typename enable_if<is_integral<_A1>::value, double>::type
1433nearbyint(_A1 __x) {return nearbyint((double)__x);}
1434
1435// nextafter
1436
1437using ::nextafter;
1438using ::nextafterf;
1439
1440inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __x, float __y) {return nextafterf(__x, __y);}
1441inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) {return nextafterl(__x, __y);}
1442
1443template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001444inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001445typename enable_if
1446<
1447 is_arithmetic<_A1>::value &&
1448 is_arithmetic<_A2>::value,
1449 typename __promote<_A1, _A2>::type
1450>::type
1451nextafter(_A1 __x, _A2 __y)
1452{
1453 typedef typename __promote<_A1, _A2>::type __result_type;
1454 static_assert((!(is_same<_A1, __result_type>::value &&
1455 is_same<_A2, __result_type>::value)), "");
1456 return nextafter((__result_type)__x, (__result_type)__y);
1457}
1458
1459// nexttoward
1460
1461using ::nexttoward;
1462using ::nexttowardf;
1463
1464inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __x, long double __y) {return nexttowardf(__x, __y);}
1465inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);}
1466
1467template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001468inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001469typename enable_if<is_integral<_A1>::value, double>::type
1470nexttoward(_A1 __x, long double __y) {return nexttoward((double)__x, __y);}
1471
1472// remainder
1473
1474using ::remainder;
1475using ::remainderf;
1476
1477inline _LIBCPP_INLINE_VISIBILITY float remainder(float __x, float __y) {return remainderf(__x, __y);}
1478inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) {return remainderl(__x, __y);}
1479
1480template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001481inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001482typename enable_if
1483<
1484 is_arithmetic<_A1>::value &&
1485 is_arithmetic<_A2>::value,
1486 typename __promote<_A1, _A2>::type
1487>::type
1488remainder(_A1 __x, _A2 __y)
1489{
1490 typedef typename __promote<_A1, _A2>::type __result_type;
1491 static_assert((!(is_same<_A1, __result_type>::value &&
1492 is_same<_A2, __result_type>::value)), "");
1493 return remainder((__result_type)__x, (__result_type)__y);
1494}
1495
1496// remquo
1497
1498using ::remquo;
1499using ::remquof;
1500
1501inline _LIBCPP_INLINE_VISIBILITY float remquo(float __x, float __y, int* __z) {return remquof(__x, __y, __z);}
1502inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) {return remquol(__x, __y, __z);}
1503
1504template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001505inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001506typename enable_if
1507<
1508 is_arithmetic<_A1>::value &&
1509 is_arithmetic<_A2>::value,
1510 typename __promote<_A1, _A2>::type
1511>::type
1512remquo(_A1 __x, _A2 __y, int* __z)
1513{
1514 typedef typename __promote<_A1, _A2>::type __result_type;
1515 static_assert((!(is_same<_A1, __result_type>::value &&
1516 is_same<_A2, __result_type>::value)), "");
1517 return remquo((__result_type)__x, (__result_type)__y, __z);
1518}
1519
1520// rint
1521
1522using ::rint;
1523using ::rintf;
1524
1525inline _LIBCPP_INLINE_VISIBILITY float rint(float __x) {return rintf(__x);}
1526inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) {return rintl(__x);}
1527
1528template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001529inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001530typename enable_if<is_integral<_A1>::value, double>::type
1531rint(_A1 __x) {return rint((double)__x);}
1532
1533// round
1534
1535using ::round;
1536using ::roundf;
1537
1538inline _LIBCPP_INLINE_VISIBILITY float round(float __x) {return roundf(__x);}
1539inline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) {return roundl(__x);}
1540
1541template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001542inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001543typename enable_if<is_integral<_A1>::value, double>::type
1544round(_A1 __x) {return round((double)__x);}
1545
1546// scalbln
1547
1548using ::scalbln;
1549using ::scalblnf;
1550
1551inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __x, long __y) {return scalblnf(__x, __y);}
1552inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) {return scalblnl(__x, __y);}
1553
1554template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001555inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001556typename enable_if<is_integral<_A1>::value, double>::type
1557scalbln(_A1 __x, long __y) {return scalbln((double)__x, __y);}
1558
1559// scalbn
1560
1561using ::scalbn;
1562using ::scalbnf;
1563
1564inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) {return scalbnf(__x, __y);}
1565inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) {return scalbnl(__x, __y);}
1566
1567template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001568inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001569typename enable_if<is_integral<_A1>::value, double>::type
1570scalbn(_A1 __x, int __y) {return scalbn((double)__x, __y);}
1571
1572// tgamma
1573
1574using ::tgamma;
1575using ::tgammaf;
1576
1577inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __x) {return tgammaf(__x);}
1578inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) {return tgammal(__x);}
1579
1580template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001581inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001582typename enable_if<is_integral<_A1>::value, double>::type
1583tgamma(_A1 __x) {return tgamma((double)__x);}
1584
1585// trunc
1586
1587using ::trunc;
1588using ::truncf;
1589
1590inline _LIBCPP_INLINE_VISIBILITY float trunc(float __x) {return truncf(__x);}
1591inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) {return truncl(__x);}
1592
1593template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001594inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001595typename enable_if<is_integral<_A1>::value, double>::type
1596trunc(_A1 __x) {return trunc((double)__x);}
1597
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001598#endif // !_MSC_VER
1599
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001600using ::acosl;
1601using ::asinl;
1602using ::atanl;
1603using ::atan2l;
1604using ::ceill;
1605using ::cosl;
1606using ::coshl;
1607using ::expl;
1608using ::fabsl;
1609using ::floorl;
1610using ::fmodl;
1611using ::frexpl;
1612using ::ldexpl;
1613using ::logl;
1614using ::log10l;
1615using ::modfl;
1616using ::powl;
1617using ::sinl;
1618using ::sinhl;
1619using ::sqrtl;
1620using ::tanl;
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001621#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001622using ::tanhl;
1623using ::acoshl;
1624using ::asinhl;
1625using ::atanhl;
1626using ::cbrtl;
Howard Hinnantec3773c2011-12-01 20:21:04 +00001627#endif // !_MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001628using ::copysignl;
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001629#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001630using ::erfl;
1631using ::erfcl;
1632using ::exp2l;
1633using ::expm1l;
1634using ::fdiml;
1635using ::fmal;
1636using ::fmaxl;
1637using ::fminl;
1638using ::hypotl;
1639using ::ilogbl;
1640using ::lgammal;
1641using ::llrintl;
1642using ::llroundl;
1643using ::log1pl;
1644using ::log2l;
1645using ::logbl;
1646using ::lrintl;
1647using ::lroundl;
1648using ::nanl;
1649using ::nearbyintl;
1650using ::nextafterl;
1651using ::nexttowardl;
1652using ::remainderl;
1653using ::remquol;
1654using ::rintl;
1655using ::roundl;
1656using ::scalblnl;
1657using ::scalbnl;
1658using ::tgammal;
1659using ::truncl;
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001660#endif // !_MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001661
David Chisnall997e4542012-02-29 13:05:08 +00001662#else
1663using ::lgamma;
1664using ::lgammaf;
1665#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001666_LIBCPP_END_NAMESPACE_STD
1667
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001668#endif // _LIBCPP_CMATH