⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _cmath.h

📁 stl的源码
💻 H
📖 第 1 页 / 共 2 页
字号:
#    else#      define _STLP_DEF_MATH_INLINE(func,cf) \      _STLP_MATH_INLINEX(float,func,cf) \      _STLP_MATH_INLINEX(long double,func,cf)#      define _STLP_DEF_MATH_INLINE2(func,cf) \      _STLP_MATH_INLINE2XX(float,func,cf) \      _STLP_MATH_INLINE2XX(long double,func,cf)#      define _STLP_DEF_MATH_INLINE2P(func,cf) \      _STLP_MATH_INLINE2PX(float,func,cf) \      _STLP_MATH_INLINE2PX(long double,func,cf)#      define _STLP_DEF_MATH_INLINE2PI(func,cf) \      _STLP_MATH_INLINE2X(float,int *,func,cf) \      _STLP_MATH_INLINE2X(long double,int *,func,cf)#      define _STLP_DEF_MATH_INLINE2I(func,cf) \      _STLP_MATH_INLINE2X(float,int,func,cf) \      _STLP_MATH_INLINE2X(long double,int,func,cf)#    endif#  else#    if !defined (_STLP_NO_VENDOR_MATH_F)#      define _STLP_DEF_MATH_INLINE(func,cf) \      _STLP_MATH_INLINE(float,func,cf##f)#      define _STLP_DEF_MATH_INLINE2(func,cf) \      _STLP_MATH_INLINE2(float,float,func,cf##f)#      define _STLP_DEF_MATH_INLINE2P(func,cf) \      _STLP_MATH_INLINE2(float,float *,func,cf##f)#      define _STLP_DEF_MATH_INLINE2PI(func,cf) \      _STLP_MATH_INLINE2(float,int *,func,cf##f)#      define _STLP_DEF_MATH_INLINE2I(func,cf) \      _STLP_MATH_INLINE2(float,int,func,cf##f)#    else // _STLP_NO_VENDOR_MATH_F       // neither long double support nor e.g. sinf(float) functions#      define _STLP_DEF_MATH_INLINE(func,cf) \      _STLP_MATH_INLINEX(float,func,cf)#      define _STLP_DEF_MATH_INLINE2(func,cf) \      _STLP_MATH_INLINE2XX(float,func,cf)#      define _STLP_DEF_MATH_INLINE2P(func,cf) \      _STLP_MATH_INLINE2PX(float,func,cf)#      define _STLP_DEF_MATH_INLINE2PI(func,cf) \      _STLP_MATH_INLINE2X(float,int *,func,cf)#      define _STLP_DEF_MATH_INLINE2I(func,cf) \      _STLP_MATH_INLINE2X(float,int,func,cf)#    endif // _STLP_NO_VENDOR_MATH_F#  endif#endif#if defined (_STLP_WCE) || \   (defined(_STLP_MSVC) && (_STLP_MSVC <= 1300) && defined (_MSC_EXTENSIONS) /* && !defined(_STLP_WCE_NET) */)/* * dums: VC6 has all the required C++ functions but only define them if * _MSC_EXTENSIONS is not defined (a bug?). STLport just do the same * thing also when _MSC_EXTENSIONS is defined. * TODO: above check (_STLP_MSVC <= 1300) also catches VC7.0, is that intended? *///We have to tell the compilers that abs, acos ... math functions are not intrinsic//otherwise we have Internal Compiler Error in release mode...#  pragma warning(push)#  pragma warning(disable: 4162) // no function with C linkage found#  pragma warning(disable: 4163) // not available as an intrinsic function#  pragma function (abs, acos, asin, atan, atan2, cos, cosh, exp, fabs, fmod, log, log10, sin, sinh, sqrt, tan, tanh)#  if defined (_STLP_WCE)#    pragma function (ceil, floor)#  endif#  define _STLP_RESTORE_FUNCTION_INTRINSIC#endif // _STLP_MSVC && _STLP_MSVC <= 1300 && !_STLP_WCE && _MSC_EXTENSIONS#if (defined (__BORLANDC__) || defined (__WATCOMC__)) && defined (_STLP_USE_NEW_C_HEADERS)/* In this config Borland native lib only define functions in std namespace. * In order to have all overloads in STLport namespace we need to add the * double overload in global namespace. We do not use a using statement to avoid * import of invalid overload. */#  define _STLP_DMATH_INLINE(func) _STLP_MATH_INLINE(double, func, func)#  define _STLP_DMATH_INLINE2(func) _STLP_MATH_INLINE2(double, double, func, func)_STLP_DMATH_INLINE(acos)_STLP_DMATH_INLINE(asin)_STLP_DMATH_INLINE(atan)_STLP_DMATH_INLINE2(atan2)_STLP_DMATH_INLINE(ceil)_STLP_DMATH_INLINE(cos)_STLP_DMATH_INLINE(cosh)_STLP_DMATH_INLINE(exp)_STLP_DMATH_INLINE(fabs)_STLP_DMATH_INLINE(floor)_STLP_DMATH_INLINE2(fmod)_STLP_MATH_INLINE2X(double, int*, frexp, frexp)_STLP_MATH_INLINE2X(double, int, ldexp, ldexp)_STLP_DMATH_INLINE(log)_STLP_DMATH_INLINE(log10)_STLP_MATH_INLINE2PX(double, modf, modf)_STLP_DMATH_INLINE(sin)_STLP_DMATH_INLINE(sinh)_STLP_DMATH_INLINE(sqrt)_STLP_DMATH_INLINE(tan)_STLP_DMATH_INLINE(tanh)_STLP_DMATH_INLINE2(pow)_STLP_DMATH_INLINE2(hypot)#  undef _STLP_DMATH_INLINE#  undef _STLP_DMATH_INLINE2#endif#if defined (__DMC__)#  if defined (fabs)inline double __stlp_fabs(double __x) { return fabs(__x); }#    undef fabsinline double fabs(double __x) { return __stlp_fabs(__x); }#  endif#  if defined (cos)inline double __stlp_cos(double __x) { return cos(__x); }#    undef cosinline double cos(double __x) { return __stlp_cos(__x); }#  endif#  if defined (sin)inline double __stlp_sin(double __x) { return sin(__x); }#    undef sininline double sin(double __x) { return __stlp_sin(__x); }#  endif#  if defined (sqrt)inline double __stlp_sqrt(double __x) { return sqrt(__x); }#    undef sqrtinline double sqrt(double __x) { return __stlp_sqrt(__x); }#  endif#  if defined (ldexp)inline double __stlp_ldexp(double __x, int __y) { return ldexp(__x, __y); }#    undef ldexpinline double ldexp(double __x, int __y) { return __stlp_ldexp(__x, __y); }#  endif#endif/* MSVC native lib starting with .Net 2003 has already all math functions * in global namespace. * HP-UX native lib has math functions in the global namespace. */#if (!defined (_STLP_MSVC_LIB) || (_STLP_MSVC_LIB < 1310) || defined(UNDER_CE)) && \    (!defined (__HP_aCC) || (__HP_aCC < 30000)) && \    !defined (__WATCOMC__)inline double abs(double __x){ return ::fabs(__x); }#  if !defined (__MVS__)_STLP_DEF_MATH_INLINE(abs, fabs)#  else // __MVS__ has native long double abs?inline float abs(float __x) { return ::fabsf(__x); }#  endif_STLP_DEF_MATH_INLINE(acos, acos)_STLP_DEF_MATH_INLINE(asin, asin)_STLP_DEF_MATH_INLINE(atan, atan)_STLP_DEF_MATH_INLINE2(atan2, atan2)_STLP_DEF_MATH_INLINE(ceil, ceil)_STLP_DEF_MATH_INLINE(cos, cos)_STLP_DEF_MATH_INLINE(cosh, cosh)_STLP_DEF_MATH_INLINE(exp, exp)_STLP_DEF_MATH_INLINE(fabs, fabs)_STLP_DEF_MATH_INLINE(floor, floor)_STLP_DEF_MATH_INLINE2(fmod, fmod)_STLP_DEF_MATH_INLINE2PI(frexp, frexp)_STLP_DEF_MATH_INLINE2I(ldexp, ldexp)_STLP_DEF_MATH_INLINE(log, log)_STLP_DEF_MATH_INLINE(log10, log10)_STLP_DEF_MATH_INLINE2P(modf, modf)_STLP_DEF_MATH_INLINE(sin, sin)_STLP_DEF_MATH_INLINE(sinh, sinh)_STLP_DEF_MATH_INLINE(sqrt, sqrt)_STLP_DEF_MATH_INLINE(tan, tan)_STLP_DEF_MATH_INLINE(tanh, tanh)_STLP_DEF_MATH_INLINE2(pow, pow)#  if !defined(_STLP_MSVC) /* || (_STLP_MSVC > 1300) */ || defined(_STLP_WCE) || !defined (_MSC_EXTENSIONS) /* && !defined(_STLP_WCE_NET) */#    ifndef _STLP_NO_VENDOR_MATH_F#      ifndef __suninline float pow(float __x, int __y) { return _STLP_CMATH_FUNC_NAMESPACE::powf(__x, __STATIC_CAST(float,__y)); }#      elseinline float pow(float __x, int __y) { return ::__powf(__x, __STATIC_CAST(float,__y)); }#      endif#    elseinline float pow(float __x, int __y) { return __STATIC_CAST(float, _STLP_CMATH_FUNC_NAMESPACE::pow(__x, __STATIC_CAST(float,__y))); }#    endifinline double pow(double __x, int __y) { return _STLP_CMATH_FUNC_NAMESPACE::pow(__x, __STATIC_CAST(double,__y)); }#    if !defined (_STLP_NO_LONG_DOUBLE)#      if !defined(_STLP_NO_VENDOR_MATH_L)#        ifndef __suninline long double pow(long double __x, int __y) { return _STLP_CMATH_FUNC_NAMESPACE::powl(__x, __STATIC_CAST(long double,__y)); }#        else#          ifndef __SUNPRO_CCinline long double pow(long double __x, int __y) { return ::__powl(__x, __STATIC_CAST(long double,__y)); }#          elseinline long double pow(long double __x, int __y) { return _STLP_VENDOR_CSTD::__powl(__x, __STATIC_CAST(long double,__y)); }#          endif#        endif#      elseinline long double pow(long double __x, int __y) { return __STATIC_CAST(long double, _STLP_CMATH_FUNC_NAMESPACE::pow(__x, __STATIC_CAST(long double,__y))); }#      endif#    endif#  else//The MS native pow version has a bugged overload so it is not imported//in the STLport namespace.//Here is the bugged version://inline double pow(int __x, int __y)            { return (_Pow_int(__x, __y)); }inline double      pow(double __x, int __y)      { return (_Pow_int(__x, __y)); }inline float       pow(float __x, int __y)       { return (_Pow_int(__x, __y)); }inline long double pow(long double __x, int __y) { return (_Pow_int(__x, __y)); }#  endif#endif#if (defined (_STLP_MSVC) && !defined (_STLP_WCE)) || defined (__ICL) || defined (__sun)#  if defined (_STLP_MSVC) && (_STLP_MSVC >= 1400)#    pragma warning (push)#    pragma warning (disable : 4996) // hypot is deprecated.#  endif_STLP_MATH_INLINE2XX(float, hypot, hypot)inline long double hypot(long double x, long double y) { return sqrt(x * x + y * y); }#  if defined (_STLP_MSVC) && (_STLP_MSVC >= 1400)#    pragma warning (pop)#  endif#else#  if defined (_STLP_USE_UCLIBC)inline double hypot(double x, double y) { return sqrt(x * x + y * y); }_STLP_DEF_MATH_INLINE2(hypot, hypot)#  elif defined (_STLP_WCE)   /* CE has a double _hypot(double,double) which we use */inline double hypot(double __x, double __y) { return _hypot(__x,__y); }_STLP_DEF_MATH_INLINE2(hypot, _hypot)#  endif#endif#if defined (_STLP_RESTORE_FUNCTION_INTRINSIC)//restoration of the default intrinsic status of those functions:#  pragma intrinsic (abs, acos, asin, atan, atan2, cos, cosh, exp, fabs, fmod, log, log10, sin, sinh, sqrt, tan, tanh)#  if defined (_STLP_WCE)#    pragma intrinsic (ceil, floor)#  endif#  pragma warning(pop)#  undef _STLP_RESTORE_FUNCTION_INTRINSIC#endif // _STLP_MSVC && _STLP_MSVC <= 1300 && !_STLP_WCE && _MSC_EXTENSIONS/* C++ Standard is unclear about several call to 'using ::func' if new overloads * of ::func appears between 2 successive 'using' calls. To avoid this potential * problem we provide all abs overload before the 'using' call. * Beware: This header inclusion has to be after all abs overload of this file. *         The first 'using ::abs' call is going to be in the other header. */#ifndef _STLP_INTERNAL_CSTDLIB#  include <stl/_cstdlib.h>#endif#if defined (_STLP_IMPORT_VENDOR_CSTD) && !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)_STLP_BEGIN_NAMESPACEusing ::abs;using ::acos;using ::asin;using ::atan;using ::atan2;using ::ceil;using ::cos;using ::cosh;using ::exp;using ::fabs;using ::floor;using ::fmod;using ::frexp;using ::hypot;using ::ldexp;using ::log;using ::log10;using ::modf;using ::pow;using ::sin;using ::sinh;using ::sqrt;using ::tan;using ::tanh;_STLP_END_NAMESPACE#  if defined (__BORLANDC__) && (__BORLANDC__ >= 0x560) && !defined (__linux__)using _STLP_VENDOR_CSTD::_ecvt;using _STLP_VENDOR_CSTD::_fcvt;#  endif#endif#endif /* _STLP_INTERNAL_CMATH */// Local Variables:// mode:C++// End:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -