~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to system/include/libcxx/cmath

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-09-20 22:44:35 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130920224435-apuwj4fsl3fqv1a6
Tags: 1.5.6~20130920~6010666-1
* New snapshot release
* Update the list of supported architectures to the same as libv8
  (Closes: #723129)
* emlibtool has been removed from upstream.
* Fix warning syntax-error-in-dep5-copyright
* Refresh of the patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
301
301
#include <math.h>
302
302
#include <type_traits>
303
303
 
304
 
#ifdef _MSC_VER
 
304
#ifdef _LIBCPP_MSVCRT
305
305
#include "support/win32/math_win32.h"
306
306
#endif
307
307
 
673
673
using ::acos;
674
674
using ::acosf;
675
675
 
676
 
#ifndef _MSC_VER
 
676
#ifndef _LIBCPP_MSVCRT
677
677
inline _LIBCPP_INLINE_VISIBILITY float       acos(float __x) _NOEXCEPT       {return acosf(__x);}
678
678
inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) _NOEXCEPT {return acosl(__x);}
679
679
#endif
688
688
using ::asin;
689
689
using ::asinf;
690
690
 
691
 
#ifndef _MSC_VER
 
691
#ifndef _LIBCPP_MSVCRT
692
692
inline _LIBCPP_INLINE_VISIBILITY float       asin(float __x) _NOEXCEPT       {return asinf(__x);}
693
693
inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) _NOEXCEPT {return asinl(__x);}
694
694
#endif
703
703
using ::atan;
704
704
using ::atanf;
705
705
 
706
 
#ifndef _MSC_VER
 
706
#ifndef _LIBCPP_MSVCRT
707
707
inline _LIBCPP_INLINE_VISIBILITY float       atan(float __x) _NOEXCEPT       {return atanf(__x);}
708
708
inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) _NOEXCEPT {return atanl(__x);}
709
709
#endif
718
718
using ::atan2;
719
719
using ::atan2f;
720
720
 
721
 
#ifndef _MSC_VER
 
721
#ifndef _LIBCPP_MSVCRT
722
722
inline _LIBCPP_INLINE_VISIBILITY float       atan2(float __y, float __x) _NOEXCEPT             {return atan2f(__y, __x);}
723
723
inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) _NOEXCEPT {return atan2l(__y, __x);}
724
724
#endif
744
744
using ::ceil;
745
745
using ::ceilf;
746
746
 
747
 
#ifndef _MSC_VER
 
747
#ifndef _LIBCPP_MSVCRT
748
748
inline _LIBCPP_INLINE_VISIBILITY float       ceil(float __x) _NOEXCEPT       {return ceilf(__x);}
749
749
inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) _NOEXCEPT {return ceill(__x);}
750
750
#endif
759
759
using ::cos;
760
760
using ::cosf;
761
761
 
762
 
#ifndef _MSC_VER
 
762
#ifndef _LIBCPP_MSVCRT
763
763
inline _LIBCPP_INLINE_VISIBILITY float       cos(float __x) _NOEXCEPT       {return cosf(__x);}
764
764
inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) _NOEXCEPT {return cosl(__x);}
765
765
#endif
774
774
using ::cosh;
775
775
using ::coshf;
776
776
 
777
 
#ifndef _MSC_VER
 
777
#ifndef _LIBCPP_MSVCRT
778
778
inline _LIBCPP_INLINE_VISIBILITY float       cosh(float __x) _NOEXCEPT       {return coshf(__x);}
779
779
inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) _NOEXCEPT {return coshl(__x);}
780
780
#endif
792
792
 
793
793
#ifndef __sun__
794
794
 
795
 
#ifndef _MSC_VER
 
795
#ifndef _LIBCPP_MSVCRT
796
796
inline _LIBCPP_INLINE_VISIBILITY float       exp(float __x) _NOEXCEPT       {return expf(__x);}
797
797
inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) _NOEXCEPT {return expl(__x);}
798
798
#endif
808
808
using ::fabs;
809
809
using ::fabsf;
810
810
 
811
 
#ifndef _MSC_VER
 
811
#ifndef _LIBCPP_MSVCRT
812
812
inline _LIBCPP_INLINE_VISIBILITY float       fabs(float __x) _NOEXCEPT       {return fabsf(__x);}
813
813
inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) _NOEXCEPT {return fabsl(__x);}
814
814
#endif
823
823
using ::floor;
824
824
using ::floorf;
825
825
 
826
 
#ifndef _MSC_VER
 
826
#ifndef _LIBCPP_MSVCRT
827
827
inline _LIBCPP_INLINE_VISIBILITY float       floor(float __x) _NOEXCEPT       {return floorf(__x);}
828
828
inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) _NOEXCEPT {return floorl(__x);}
829
829
#endif
840
840
using ::fmodf;
841
841
#ifndef __sun__
842
842
 
843
 
#ifndef _MSC_VER
 
843
#ifndef _LIBCPP_MSVCRT
844
844
inline _LIBCPP_INLINE_VISIBILITY float       fmod(float __x, float __y) _NOEXCEPT             {return fmodf(__x, __y);}
845
845
inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) _NOEXCEPT {return fmodl(__x, __y);}
846
846
#endif
867
867
using ::frexp;
868
868
using ::frexpf;
869
869
 
870
 
#ifndef _MSC_VER
 
870
#ifndef _LIBCPP_MSVCRT
871
871
inline _LIBCPP_INLINE_VISIBILITY float       frexp(float __x, int* __e) _NOEXCEPT       {return frexpf(__x, __e);}
872
872
inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) _NOEXCEPT {return frexpl(__x, __e);}
873
873
#endif
882
882
using ::ldexp;
883
883
using ::ldexpf;
884
884
 
885
 
#ifndef _MSC_VER
 
885
#ifndef _LIBCPP_MSVCRT
886
886
inline _LIBCPP_INLINE_VISIBILITY float       ldexp(float __x, int __e) _NOEXCEPT       {return ldexpf(__x, __e);}
887
887
inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) _NOEXCEPT {return ldexpl(__x, __e);}
888
888
#endif
899
899
using ::logf;
900
900
#ifndef __sun__
901
901
 
902
 
#ifndef _MSC_VER
 
902
#ifndef _LIBCPP_MSVCRT
903
903
inline _LIBCPP_INLINE_VISIBILITY float       log(float __x) _NOEXCEPT       {return logf(__x);}
904
904
inline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) _NOEXCEPT {return logl(__x);}
905
905
#endif
915
915
using ::log10;
916
916
using ::log10f;
917
917
 
918
 
#ifndef _MSC_VER
 
918
#ifndef _LIBCPP_MSVCRT
919
919
inline _LIBCPP_INLINE_VISIBILITY float       log10(float __x) _NOEXCEPT       {return log10f(__x);}
920
920
inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) _NOEXCEPT {return log10l(__x);}
921
921
#endif
930
930
using ::modf;
931
931
using ::modff;
932
932
 
933
 
#ifndef _MSC_VER
 
933
#ifndef _LIBCPP_MSVCRT
934
934
inline _LIBCPP_INLINE_VISIBILITY float       modf(float __x, float* __y) _NOEXCEPT             {return modff(__x, __y);}
935
935
inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) _NOEXCEPT {return modfl(__x, __y);}
936
936
#endif
943
943
 
944
944
#ifndef __sun__
945
945
 
946
 
#ifndef _MSC_VER
 
946
#ifndef _LIBCPP_MSVCRT
947
947
inline _LIBCPP_INLINE_VISIBILITY float       pow(float __x, float __y) _NOEXCEPT             {return powf(__x, __y);}
948
948
inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) _NOEXCEPT {return powl(__x, __y);}
949
949
#endif
970
970
using ::sin;
971
971
using ::sinf;
972
972
 
973
 
#ifndef _MSC_VER
 
973
#ifndef _LIBCPP_MSVCRT
974
974
inline _LIBCPP_INLINE_VISIBILITY float       sin(float __x) _NOEXCEPT       {return sinf(__x);}
975
975
inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) _NOEXCEPT {return sinl(__x);}
976
976
#endif
985
985
using ::sinh;
986
986
using ::sinhf;
987
987
 
988
 
#ifndef _MSC_VER
 
988
#ifndef _LIBCPP_MSVCRT
989
989
inline _LIBCPP_INLINE_VISIBILITY float       sinh(float __x) _NOEXCEPT       {return sinhf(__x);}
990
990
inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) _NOEXCEPT {return sinhl(__x);}
991
991
#endif
1002
1002
using ::sqrtf;
1003
1003
 
1004
1004
 
1005
 
#if !(defined(_MSC_VER) || defined(__sun__))
 
1005
#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__))
1006
1006
inline _LIBCPP_INLINE_VISIBILITY float       sqrt(float __x) _NOEXCEPT       {return sqrtf(__x);}
1007
1007
inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) _NOEXCEPT {return sqrtl(__x);}
1008
1008
#endif
1018
1018
using ::tanf;
1019
1019
#ifndef __sun__
1020
1020
 
1021
 
#ifndef _MSC_VER
 
1021
#ifndef _LIBCPP_MSVCRT
1022
1022
inline _LIBCPP_INLINE_VISIBILITY float       tan(float __x) _NOEXCEPT       {return tanf(__x);}
1023
1023
inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) _NOEXCEPT {return tanl(__x);}
1024
1024
#endif
1033
1033
using ::tanh;
1034
1034
using ::tanhf;
1035
1035
 
1036
 
#ifndef _MSC_VER
 
1036
#ifndef _LIBCPP_MSVCRT
1037
1037
inline _LIBCPP_INLINE_VISIBILITY float       tanh(float __x) _NOEXCEPT       {return tanhf(__x);}
1038
1038
inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) _NOEXCEPT {return tanhl(__x);}
1039
1039
#endif
1045
1045
 
1046
1046
// acosh
1047
1047
 
1048
 
#ifndef _MSC_VER
 
1048
#ifndef _LIBCPP_MSVCRT
1049
1049
using ::acosh;
1050
1050
using ::acoshf;
1051
1051
 
1060
1060
 
1061
1061
// asinh
1062
1062
 
1063
 
#ifndef _MSC_VER
 
1063
#ifndef _LIBCPP_MSVCRT
1064
1064
using ::asinh;
1065
1065
using ::asinhf;
1066
1066
 
1075
1075
 
1076
1076
// atanh
1077
1077
 
1078
 
#ifndef _MSC_VER
 
1078
#ifndef _LIBCPP_MSVCRT
1079
1079
using ::atanh;
1080
1080
using ::atanhf;
1081
1081
 
1090
1090
 
1091
1091
// cbrt
1092
1092
 
1093
 
#ifndef _MSC_VER
 
1093
#ifndef _LIBCPP_MSVCRT
1094
1094
using ::cbrt;
1095
1095
using ::cbrtf;
1096
1096
 
1127
1127
    return copysign((__result_type)__x, (__result_type)__y);
1128
1128
}
1129
1129
 
1130
 
#ifndef _MSC_VER
 
1130
#ifndef _LIBCPP_MSVCRT
1131
1131
 
1132
1132
// erf
1133
1133
 
1426
1426
typename enable_if<is_integral<_A1>::value, long>::type
1427
1427
lround(_A1 __x) _NOEXCEPT {return lround((double)__x);}
1428
1428
 
 
1429
#endif // _LIBCPP_MSVCRT
 
1430
#endif // __sun__
 
1431
 
1429
1432
// nan
1430
 
#endif // _MSC_VER
1431
 
#endif // __sun__
 
1433
 
 
1434
#ifndef _LIBCPP_MSVCRT
1432
1435
using ::nan;
1433
1436
using ::nanf;
 
1437
#endif // _LIBCPP_MSVCRT
 
1438
 
1434
1439
#ifndef __sun__
1435
 
#ifndef _MSC_VER
 
1440
#ifndef _LIBCPP_MSVCRT
1436
1441
 
1437
1442
// nearbyint
1438
1443
 
1610
1615
typename enable_if<is_integral<_A1>::value, double>::type
1611
1616
trunc(_A1 __x) _NOEXCEPT {return trunc((double)__x);}
1612
1617
 
1613
 
#endif // !_MSC_VER
 
1618
#endif // !_LIBCPP_MSVCRT
1614
1619
 
1615
1620
using ::acosl;
1616
1621
using ::asinl;
1633
1638
using ::sinhl;
1634
1639
using ::sqrtl;
1635
1640
using ::tanl;
1636
 
#ifndef _MSC_VER
 
1641
#ifndef _LIBCPP_MSVCRT
1637
1642
using ::tanhl;
1638
1643
using ::acoshl;
1639
1644
using ::asinhl;
1640
1645
using ::atanhl;
1641
1646
using ::cbrtl;
1642
 
#endif  // !_MSC_VER
 
1647
#endif  // !_LIBCPP_MSVCRT
1643
1648
using ::copysignl;
1644
 
#ifndef _MSC_VER
 
1649
#ifndef _LIBCPP_MSVCRT
1645
1650
using ::erfl;
1646
1651
using ::erfcl;
1647
1652
using ::exp2l;
1672
1677
using ::scalbnl;
1673
1678
using ::tgammal;
1674
1679
using ::truncl;
1675
 
#endif // !_MSC_VER
 
1680
#endif // !_LIBCPP_MSVCRT
1676
1681
 
1677
1682
#else 
1678
1683
using ::lgamma;