ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_cmath.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1999
00003  * Boris Fomitchev
00004  *
00005  * This material is provided "as is", with absolutely no warranty expressed
00006  * or implied. Any use is at your own risk.
00007  *
00008  * Permission to use or copy this software for any purpose is hereby granted
00009  * without fee, provided the above notices are retained on all copies.
00010  * Permission to modify the code and to distribute modified code is granted,
00011  * provided the above notices are retained, and a notice that the code was
00012  * modified is included with the above copyright notice.
00013  *
00014  */
00015 
00016 #ifndef _STLP_INTERNAL_CMATH
00017 #define _STLP_INTERNAL_CMATH
00018 
00019 /* gcc do not like when a using directive appear after a function
00020  * declaration. cmath have abs overloads and cstdlib a using directive
00021  * so cstdlib has to be included first.
00022  */
00023 #if defined (__GNUC__) && defined (_STLP_USE_NEW_C_HEADERS)
00024 #  if defined (_STLP_HAS_INCLUDE_NEXT)
00025 #    include_next <cstdlib>
00026 #  else
00027 #    include _STLP_NATIVE_CPP_C_HEADER(cstdlib)
00028 #  endif
00029 #endif
00030 
00031 #if defined (_STLP_USE_NEW_C_HEADERS)
00032 #  if defined (_STLP_HAS_NO_NAMESPACES) && !defined (exception)
00033 #    define exception __math_exception
00034 #  endif
00035 #  if defined (_STLP_HAS_INCLUDE_NEXT)
00036 #    include_next <cmath>
00037 #  else
00038 #    include _STLP_NATIVE_CPP_C_HEADER(cmath)
00039 #  endif
00040 #  if defined (_STLP_HAS_NO_NAMESPACES)
00041 #    undef exception
00042 #  endif
00043 #else
00044 #  include <math.h>
00045 #endif
00046 
00047 #if (defined (__SUNPRO_CC) && (__SUNPRO_CC > 0x500)) || \
00048      !(defined (__IBMCPP__) && (__IBMCPP__ >= 500) || !(defined(__HP_aCC) && (__HP_aCC >= 30000) ))
00049 #  if !defined(_STLP_HAS_NO_NAMESPACES) && !defined(__SUNPRO_CC)
00050 // All the other hypot stuff is going to be at file scope, so follow along here.
00051 namespace std {
00052 #  endif
00053 extern "C" double hypot(double x, double y);
00054 #  if !defined(_STLP_HAS_NO_NAMESPACES) && !defined(__SUNPRO_CC)
00055 }
00056 #  endif
00057 
00058 #endif
00059 
00060 #if defined (__sun) && defined (__GNUC__)
00061 extern "C" {
00062   float __cosf(float v);
00063   float __sinf(float v);
00064   float __atan2f(float, float);
00065   float __coshf(float v);
00066   float __sinhf(float v);
00067   float __sqrtf(float v);
00068   float __expf(float v);
00069   float __logf(float v);
00070   float __log10f(float v);
00071 
00072   long double __cosl(long double v);
00073   long double __sinl(long double v);
00074   long double __atan2l(long double, long double);
00075   long double __coshl(long double v);
00076   long double __sinhl(long double v);
00077   long double __sqrtl(long double v);
00078   long double __expl(long double v);
00079   long double __logl(long double v);
00080   long double __log10l(long double v);
00081 }
00082 
00083 extern "C" {
00084   inline float cosf(float v) { return __cosf(v); }
00085   inline float sinf(float v) { return __sinf(v); }
00086   inline float atan2f(float v1, float v2) { return __atan2f(v1,v2); }
00087   inline float coshf(float v) { return __coshf(v); }
00088   inline float sinhf(float v) { return __sinhf(v); }
00089   inline float sqrtf(float v) { return __sqrtf(v); }
00090   inline float expf(float v) { return __expf(v); }
00091   inline float logf(float v) { return __logf(v); }
00092   inline float log10f(float v) { return __log10f(v); }
00093 
00094   inline long double cosl(long double v) { return __cosl(v); }
00095   inline long double sinl(long double v) { return __sinl(v); }
00096   inline long double atan2l(long double v1, long double v2) { return __atan2l(v1,v2); }
00097   inline long double coshl(long double v) { return __coshl(v); }
00098   inline long double sinhl(long double v) { return __sinhl(v); }
00099   inline long double sqrtl(long double v) { return __sqrtl(v); }
00100   inline long double expl(long double v) { return __expl(v); }
00101   inline long double logl(long double v) { return __logl(v); }
00102   inline long double log10l(long double v) { return __log10l(v); }
00103 }
00104 #endif // __sun && __GNUC__
00105 
00106 #if defined (__sun)
00107 extern "C" {
00108 extern float __acosf(float);
00109 extern float __asinf(float);
00110 extern float __atanf(float);
00111 extern float __atan2f(float, float);
00112 extern float __ceilf(float);
00113 extern float __cosf(float);
00114 extern float __coshf(float);
00115 extern float __expf(float);
00116 extern float __fabsf(float);
00117 extern float __floorf(float);
00118 extern float __fmodf(float, float);
00119 extern float __frexpf(float, int *);
00120 extern float __ldexpf(float, int);
00121 extern float __logf(float);
00122 extern float __log10f(float);
00123 extern float __modff(float, float *);
00124 extern float __powf(float, float);
00125 extern float __sinf(float);
00126 extern float __sinhf(float);
00127 extern float __sqrtf(float);
00128 extern float __tanf(float);
00129 extern float __tanhf(float);
00130 
00131 extern long double __acosl(long double);
00132 extern long double __asinl(long double);
00133 extern long double __atanl(long double);
00134 extern long double __atan2l(long double, long double);
00135 extern long double __ceill(long double);
00136 extern long double __cosl(long double);
00137 extern long double __coshl(long double);
00138 extern long double __expl(long double);
00139 extern long double __fabsl(long double);
00140 extern long double __floorl(long double);
00141 extern long double __fmodl(long double, long double);
00142 extern long double __frexpl(long double, int *);
00143 extern long double __ldexpl(long double, int);
00144 extern long double __logl(long double);
00145 extern long double __log10l(long double);
00146 extern long double __modfl(long double, long double *);
00147 extern long double __powl(long double, long double);
00148 extern long double __sinl(long double);
00149 extern long double __sinhl(long double);
00150 extern long double __sqrtl(long double);
00151 extern long double __tanl(long double);
00152 extern long double __tanhl(long double);
00153 }
00154 #endif
00155 
00156 #if defined (__BORLANDC__)
00157 #  define _STLP_CMATH_FUNC_NAMESPACE _STLP_VENDOR_CSTD
00158 #else
00159 #  define _STLP_CMATH_FUNC_NAMESPACE
00160 #endif
00161 
00162 #if !defined (__sun) || defined (__GNUC__)
00163 #  define _STLP_MATH_INLINE(float_type, func, cfunc) \
00164      inline float_type func (float_type x) { return _STLP_CMATH_FUNC_NAMESPACE::cfunc(x); }
00165 #  define _STLP_MATH_INLINE2(float_type, type, func, cfunc) \
00166      inline float_type func (float_type x, type y) { return _STLP_CMATH_FUNC_NAMESPACE::cfunc(x, y); }
00167 #  define _STLP_MATH_INLINE_D(float_type, func, cfunc)
00168 #  define _STLP_MATH_INLINE2_D(float_type, type, func, cfunc)
00169 #else
00170 #  ifdef __SUNPRO_CC
00171 #    define _STLP_MATH_INLINE(float_type, func, cfunc) \
00172        inline float_type func (float_type x) { return _STLP_VENDOR_CSTD::__##cfunc(x); }
00173 #    define _STLP_MATH_INLINE_D(float_type, func, cfunc) \
00174        inline float_type func (float_type x) { return _STLP_VENDOR_CSTD::cfunc(x); }
00175 #    define _STLP_MATH_INLINE2(float_type, type, func, cfunc) \
00176        inline float_type func (float_type x, type y) { return _STLP_VENDOR_CSTD::__##cfunc(x,y); }
00177 #    define _STLP_MATH_INLINE2_D(float_type, type, func, cfunc) \
00178        inline float_type func (float_type x, type y) { return _STLP_VENDOR_CSTD::cfunc(x,y); }
00179 #  else
00180 #    error Unknown compiler for the Sun platform
00181 #  endif
00182 #endif
00183 
00188 #define _STLP_MATH_INLINEX(__type,func,cfunc) \
00189   inline __type func (__type x) \
00190   { return __STATIC_CAST(__type, _STLP_CMATH_FUNC_NAMESPACE::cfunc((double)x)); }
00191 #define _STLP_MATH_INLINE2X(__type1,__type2,func,cfunc) \
00192   inline __type1 func (__type1 x, __type2 y) \
00193   { return __STATIC_CAST(__type1, _STLP_CMATH_FUNC_NAMESPACE::cfunc((double)x, y)); }
00194 #define _STLP_MATH_INLINE2PX(__type,func,cfunc) \
00195   inline __type func (__type x, __type *y) { \
00196     double tmp1, tmp2; \
00197     tmp1 = _STLP_CMATH_FUNC_NAMESPACE::cfunc(__STATIC_CAST(double, x), &tmp2); \
00198     *y = __STATIC_CAST(__type, tmp2); \
00199     return __STATIC_CAST(__type, tmp1); \
00200   }
00201 #define _STLP_MATH_INLINE2XX(__type,func,cfunc) \
00202   inline __type func (__type x, __type y) \
00203   { return __STATIC_CAST(__type, _STLP_CMATH_FUNC_NAMESPACE::cfunc((double)x, (double)y)); }
00204 
00205 
00228 #if !defined (_STLP_NO_LONG_DOUBLE) && !defined (_STLP_NO_VENDOR_MATH_L) && !defined (_STLP_NO_VENDOR_MATH_F)
00229    // long double support and both e.g. sinl(long double) and sinf(float)
00230    // This is the default for a correct and complete native library.
00231 #  define _STLP_DEF_MATH_INLINE(func,cf) \
00232   _STLP_MATH_INLINE(float,func,cf##f) \
00233   _STLP_MATH_INLINE_D(double,func,cf) \
00234   _STLP_MATH_INLINE(long double,func,cf##l)
00235 #  define _STLP_DEF_MATH_INLINE2(func,cf) \
00236   _STLP_MATH_INLINE2(float,float,func,cf##f) \
00237   _STLP_MATH_INLINE2_D(double,double,func,cf) \
00238   _STLP_MATH_INLINE2(long double,long double,func,cf##l)
00239 #  define _STLP_DEF_MATH_INLINE2P(func,cf) \
00240   _STLP_MATH_INLINE2(float,float *,func,cf##f) \
00241   _STLP_MATH_INLINE2_D(double,double *,func,cf) \
00242   _STLP_MATH_INLINE2(long double,long double *,func,cf##l)
00243 #  define _STLP_DEF_MATH_INLINE2PI(func,cf) \
00244   _STLP_MATH_INLINE2(float,int *,func,cf##f) \
00245   _STLP_MATH_INLINE2_D(double,int *,func,cf) \
00246   _STLP_MATH_INLINE2(long double,int *,func,cf##l)
00247 #  define _STLP_DEF_MATH_INLINE2I(func,cf) \
00248   _STLP_MATH_INLINE2(float,int,func,cf##f) \
00249   _STLP_MATH_INLINE2_D(double,int,func,cf) \
00250   _STLP_MATH_INLINE2(long double,int,func,cf##l)
00251 #else
00252 #  if !defined (_STLP_NO_LONG_DOUBLE)
00253 #    if !defined (_STLP_NO_VENDOR_MATH_F)
00254        // long double support and e.g. sinf(float) but not e.g. sinl(long double)
00255 #      define _STLP_DEF_MATH_INLINE(func,cf) \
00256       _STLP_MATH_INLINE(float,func,cf##f) \
00257       _STLP_MATH_INLINEX(long double,func,cf)
00258 #      define _STLP_DEF_MATH_INLINE2(func,cf) \
00259       _STLP_MATH_INLINE2(float,float,func,cf##f) \
00260       _STLP_MATH_INLINE2XX(long double,func,cf)
00261 #      define _STLP_DEF_MATH_INLINE2P(func,cf) \
00262       _STLP_MATH_INLINE2(float,float *,func,cf##f) \
00263       _STLP_MATH_INLINE2PX(long double,func,cf)
00264 #      define _STLP_DEF_MATH_INLINE2PI(func,cf) \
00265       _STLP_MATH_INLINE2(float,int *,func,cf##f) \
00266       _STLP_MATH_INLINE2X(long double,int *,func,cf)
00267 #      define _STLP_DEF_MATH_INLINE2I(func,cf) \
00268       _STLP_MATH_INLINE2(float,int,func,cf##f) \
00269       _STLP_MATH_INLINE2X(long double,int,func,cf)
00270 #    elif !defined (_STLP_NO_VENDOR_MATH_L)
00271        // long double support and e.g. sinl(long double) but not e.g. sinf(float)
00272 #      define _STLP_DEF_MATH_INLINE(func,cf) \
00273       _STLP_MATH_INLINEX(float,func,cf) \
00274       _STLP_MATH_INLINE(long double,func,cf##l)
00275 #      define _STLP_DEF_MATH_INLINE2(func,cf) \
00276       _STLP_MATH_INLINE2XX(float,func,cf) \
00277       _STLP_MATH_INLINE2(long double,long double,func,cf##l)
00278 #      define _STLP_DEF_MATH_INLINE2P(func,cf) \
00279       _STLP_MATH_INLINE2PX(float,func,cf) \
00280       _STLP_MATH_INLINE2(long double,long double *,func,cf##l)
00281 #      define _STLP_DEF_MATH_INLINE2PI(func,cf) \
00282       _STLP_MATH_INLINE2X(float,int *,func,cf) \
00283       _STLP_MATH_INLINE2(long double,int *,func,cf##l)
00284 #      define _STLP_DEF_MATH_INLINE2I(func,cf) \
00285       _STLP_MATH_INLINE2X(float,int,func,cf) \
00286       _STLP_MATH_INLINE2(long double,int,func,cf##l)
00287 #    else
00288 #      define _STLP_DEF_MATH_INLINE(func,cf) \
00289       _STLP_MATH_INLINEX(float,func,cf) \
00290       _STLP_MATH_INLINEX(long double,func,cf)
00291 #      define _STLP_DEF_MATH_INLINE2(func,cf) \
00292       _STLP_MATH_INLINE2XX(float,func,cf) \
00293       _STLP_MATH_INLINE2XX(long double,func,cf)
00294 #      define _STLP_DEF_MATH_INLINE2P(func,cf) \
00295       _STLP_MATH_INLINE2PX(float,func,cf) \
00296       _STLP_MATH_INLINE2PX(long double,func,cf)
00297 #      define _STLP_DEF_MATH_INLINE2PI(func,cf) \
00298       _STLP_MATH_INLINE2X(float,int *,func,cf) \
00299       _STLP_MATH_INLINE2X(long double,int *,func,cf)
00300 #      define _STLP_DEF_MATH_INLINE2I(func,cf) \
00301       _STLP_MATH_INLINE2X(float,int,func,cf) \
00302       _STLP_MATH_INLINE2X(long double,int,func,cf)
00303 #    endif
00304 #  else
00305 #    if !defined (_STLP_NO_VENDOR_MATH_F)
00306 #      define _STLP_DEF_MATH_INLINE(func,cf) \
00307       _STLP_MATH_INLINE(float,func,cf##f)
00308 #      define _STLP_DEF_MATH_INLINE2(func,cf) \
00309       _STLP_MATH_INLINE2(float,float,func,cf##f)
00310 #      define _STLP_DEF_MATH_INLINE2P(func,cf) \
00311       _STLP_MATH_INLINE2(float,float *,func,cf##f)
00312 #      define _STLP_DEF_MATH_INLINE2PI(func,cf) \
00313       _STLP_MATH_INLINE2(float,int *,func,cf##f)
00314 #      define _STLP_DEF_MATH_INLINE2I(func,cf) \
00315       _STLP_MATH_INLINE2(float,int,func,cf##f)
00316 #    else // _STLP_NO_VENDOR_MATH_F
00317        // neither long double support nor e.g. sinf(float) functions
00318 #      define _STLP_DEF_MATH_INLINE(func,cf) \
00319       _STLP_MATH_INLINEX(float,func,cf)
00320 #      define _STLP_DEF_MATH_INLINE2(func,cf) \
00321       _STLP_MATH_INLINE2XX(float,func,cf)
00322 #      define _STLP_DEF_MATH_INLINE2P(func,cf) \
00323       _STLP_MATH_INLINE2PX(float,func,cf)
00324 #      define _STLP_DEF_MATH_INLINE2PI(func,cf) \
00325       _STLP_MATH_INLINE2X(float,int *,func,cf)
00326 #      define _STLP_DEF_MATH_INLINE2I(func,cf) \
00327       _STLP_MATH_INLINE2X(float,int,func,cf)
00328 #    endif // _STLP_NO_VENDOR_MATH_F
00329 #  endif
00330 #endif
00331 
00332 #if defined (_STLP_WCE) || \
00333    (defined(_STLP_MSVC) && (_STLP_MSVC <= 1300) && defined (_MSC_EXTENSIONS) /* && !defined(_STLP_WCE_NET) */)
00334 /*
00335  * dums: VC6 has all the required C++ functions but only define them if
00336  * _MSC_EXTENSIONS is not defined (a bug?). STLport just do the same
00337  * thing also when _MSC_EXTENSIONS is defined.
00338  * TODO: above check (_STLP_MSVC <= 1300) also catches VC7.0, is that intended?
00339  */
00340 //We have to tell the compilers that abs, acos ... math functions are not intrinsic
00341 //otherwise we have Internal Compiler Error in release mode...
00342 #  pragma warning(push)
00343 #  pragma warning(disable: 4162) // no function with C linkage found
00344 #  pragma warning(disable: 4163) // not available as an intrinsic function
00345 #  pragma function (abs, acos, asin, atan, atan2, cos, cosh, exp, fabs, fmod, log, log10, sin, sinh, sqrt, tan, tanh)
00346 #  if defined (_STLP_WCE)
00347 #    pragma function (ceil, floor)
00348 #  endif
00349 #  define _STLP_RESTORE_FUNCTION_INTRINSIC
00350 #endif // _STLP_MSVC && _STLP_MSVC <= 1300 && !_STLP_WCE && _MSC_EXTENSIONS
00351 
00352 #if (defined (__BORLANDC__) || defined (__WATCOMC__)) && defined (_STLP_USE_NEW_C_HEADERS)
00353 /* In this config Borland native lib only define functions in std namespace.
00354  * In order to have all overloads in STLport namespace we need to add the
00355  * double overload in global namespace. We do not use a using statement to avoid
00356  * import of invalid overload.
00357  */
00358 #  define _STLP_DMATH_INLINE(func) _STLP_MATH_INLINE(double, func, func)
00359 #  define _STLP_DMATH_INLINE2(func) _STLP_MATH_INLINE2(double, double, func, func)
00360 
00361 _STLP_DMATH_INLINE(acos)
00362 _STLP_DMATH_INLINE(asin)
00363 _STLP_DMATH_INLINE(atan)
00364 _STLP_DMATH_INLINE2(atan2)
00365 _STLP_DMATH_INLINE(ceil)
00366 _STLP_DMATH_INLINE(cos)
00367 _STLP_DMATH_INLINE(cosh)
00368 _STLP_DMATH_INLINE(exp)
00369 _STLP_DMATH_INLINE(fabs)
00370 _STLP_DMATH_INLINE(floor)
00371 _STLP_DMATH_INLINE2(fmod)
00372 _STLP_MATH_INLINE2X(double, int*, frexp, frexp)
00373 _STLP_MATH_INLINE2X(double, int, ldexp, ldexp)
00374 _STLP_DMATH_INLINE(log)
00375 _STLP_DMATH_INLINE(log10)
00376 _STLP_MATH_INLINE2PX(double, modf, modf)
00377 _STLP_DMATH_INLINE(sin)
00378 _STLP_DMATH_INLINE(sinh)
00379 _STLP_DMATH_INLINE(sqrt)
00380 _STLP_DMATH_INLINE(tan)
00381 _STLP_DMATH_INLINE(tanh)
00382 _STLP_DMATH_INLINE2(pow)
00383 _STLP_DMATH_INLINE2(hypot)
00384 
00385 #  undef _STLP_DMATH_INLINE
00386 #  undef _STLP_DMATH_INLINE2
00387 #endif
00388 
00389 #if defined (__DMC__)
00390 #  if defined (fabs)
00391 inline double __stlp_fabs(double __x) { return fabs(__x); }
00392 #    undef fabs
00393 inline double fabs(double __x) { return __stlp_fabs(__x); }
00394 #  endif
00395 #  if defined (cos)
00396 inline double __stlp_cos(double __x) { return cos(__x); }
00397 #    undef cos
00398 inline double cos(double __x) { return __stlp_cos(__x); }
00399 #  endif
00400 #  if defined (sin)
00401 inline double __stlp_sin(double __x) { return sin(__x); }
00402 #    undef sin
00403 inline double sin(double __x) { return __stlp_sin(__x); }
00404 #  endif
00405 #  if defined (sqrt)
00406 inline double __stlp_sqrt(double __x) { return sqrt(__x); }
00407 #    undef sqrt
00408 inline double sqrt(double __x) { return __stlp_sqrt(__x); }
00409 #  endif
00410 #  if defined (ldexp)
00411 inline double __stlp_ldexp(double __x, int __y) { return ldexp(__x, __y); }
00412 #    undef ldexp
00413 inline double ldexp(double __x, int __y) { return __stlp_ldexp(__x, __y); }
00414 #  endif
00415 #endif
00416 
00417 /* MSVC native lib starting with .Net 2003 has already all math functions
00418  * in global namespace.
00419  * HP-UX native lib has math functions in the global namespace.
00420  */
00421 #if (!defined (_STLP_MSVC_LIB) || (_STLP_MSVC_LIB < 1310) || defined(UNDER_CE)) && \
00422     (!defined (__HP_aCC) || (__HP_aCC < 30000)) && \
00423     !defined (__WATCOMC__)
00424 inline double abs(double __x)
00425 { return ::fabs(__x); }
00426 #  if !defined (__MVS__)
00427 _STLP_DEF_MATH_INLINE(abs, fabs)
00428 #  else // __MVS__ has native long double abs?
00429 inline float abs(float __x) { return ::fabsf(__x); }
00430 #  endif
00431 
00432 _STLP_DEF_MATH_INLINE(acos, acos)
00433 _STLP_DEF_MATH_INLINE(asin, asin)
00434 _STLP_DEF_MATH_INLINE(atan, atan)
00435 _STLP_DEF_MATH_INLINE2(atan2, atan2)
00436 _STLP_DEF_MATH_INLINE(ceil, ceil)
00437 _STLP_DEF_MATH_INLINE(cos, cos)
00438 _STLP_DEF_MATH_INLINE(cosh, cosh)
00439 _STLP_DEF_MATH_INLINE(exp, exp)
00440 _STLP_DEF_MATH_INLINE(fabs, fabs)
00441 _STLP_DEF_MATH_INLINE(floor, floor)
00442 _STLP_DEF_MATH_INLINE2(fmod, fmod)
00443 _STLP_DEF_MATH_INLINE2PI(frexp, frexp)
00444 _STLP_DEF_MATH_INLINE2I(ldexp, ldexp)
00445 _STLP_DEF_MATH_INLINE(log, log)
00446 _STLP_DEF_MATH_INLINE(log10, log10)
00447 _STLP_DEF_MATH_INLINE2P(modf, modf)
00448 _STLP_DEF_MATH_INLINE(sin, sin)
00449 _STLP_DEF_MATH_INLINE(sinh, sinh)
00450 _STLP_DEF_MATH_INLINE(sqrt, sqrt)
00451 _STLP_DEF_MATH_INLINE(tan, tan)
00452 _STLP_DEF_MATH_INLINE(tanh, tanh)
00453 _STLP_DEF_MATH_INLINE2(pow, pow)
00454 
00455 #  if !defined(_STLP_MSVC) /* || (_STLP_MSVC > 1300) */ || defined(_STLP_WCE) || !defined (_MSC_EXTENSIONS) /* && !defined(_STLP_WCE_NET) */
00456 #    ifndef _STLP_NO_VENDOR_MATH_F
00457 #      ifndef __sun
00458 inline float pow(float __x, int __y) { return _STLP_CMATH_FUNC_NAMESPACE::powf(__x, __STATIC_CAST(float,__y)); }
00459 #      else
00460 inline float pow(float __x, int __y) { return ::__powf(__x, __STATIC_CAST(float,__y)); }
00461 #      endif
00462 #    else
00463 inline float pow(float __x, int __y) { return __STATIC_CAST(float, _STLP_CMATH_FUNC_NAMESPACE::pow(__x, __STATIC_CAST(float,__y))); }
00464 #    endif
00465 inline double pow(double __x, int __y) { return _STLP_CMATH_FUNC_NAMESPACE::pow(__x, __STATIC_CAST(double,__y)); }
00466 #    if !defined (_STLP_NO_LONG_DOUBLE)
00467 #      if !defined(_STLP_NO_VENDOR_MATH_L)
00468 #        ifndef __sun
00469 inline long double pow(long double __x, int __y) { return _STLP_CMATH_FUNC_NAMESPACE::powl(__x, __STATIC_CAST(long double,__y)); }
00470 #        else
00471 #          ifndef __SUNPRO_CC
00472 inline long double pow(long double __x, int __y) { return ::__powl(__x, __STATIC_CAST(long double,__y)); }
00473 #          else
00474 inline long double pow(long double __x, int __y) { return _STLP_VENDOR_CSTD::__powl(__x, __STATIC_CAST(long double,__y)); }
00475 #          endif
00476 #        endif
00477 #      else
00478 inline long double pow(long double __x, int __y) { return __STATIC_CAST(long double, _STLP_CMATH_FUNC_NAMESPACE::pow(__x, __STATIC_CAST(long double,__y))); }
00479 #      endif
00480 #    endif
00481 #  else
00482 //The MS native pow version has a bugged overload so it is not imported
00483 //in the STLport namespace.
00484 //Here is the bugged version:
00485 //inline double pow(int __x, int __y)            { return (_Pow_int(__x, __y)); }
00486 inline double      pow(double __x, int __y)      { return (_Pow_int(__x, __y)); }
00487 inline float       pow(float __x, int __y)       { return (_Pow_int(__x, __y)); }
00488 inline long double pow(long double __x, int __y) { return (_Pow_int(__x, __y)); }
00489 #  endif
00490 #endif
00491 
00492 #if (defined (_STLP_MSVC) && !defined (_STLP_WCE)) || defined (__ICL) || defined (__sun)
00493 #  if defined (_STLP_MSVC) && (_STLP_MSVC >= 1400)
00494 #    pragma warning (push)
00495 #    pragma warning (disable : 4996) // hypot is deprecated.
00496 #  endif
00497 _STLP_MATH_INLINE2XX(float, hypot, hypot)
00498 inline long double hypot(long double x, long double y) { return sqrt(x * x + y * y); }
00499 #  if defined (_STLP_MSVC) && (_STLP_MSVC >= 1400)
00500 #    pragma warning (pop)
00501 #  endif
00502 #else
00503 #  if defined (_STLP_USE_UCLIBC)
00504 inline double hypot(double x, double y) { return sqrt(x * x + y * y); }
00505 _STLP_DEF_MATH_INLINE2(hypot, hypot)
00506 #  elif defined (_STLP_WCE)
00507    /* CE has a double _hypot(double,double) which we use */
00508 inline double hypot(double __x, double __y) { return _hypot(__x,__y); }
00509 _STLP_DEF_MATH_INLINE2(hypot, _hypot)
00510 #  endif
00511 #endif
00512 
00513 #if defined (_STLP_RESTORE_FUNCTION_INTRINSIC)
00514 //restoration of the default intrinsic status of those functions:
00515 #  pragma intrinsic (abs, acos, asin, atan, atan2, cos, cosh, exp, fabs, fmod, log, log10, sin, sinh, sqrt, tan, tanh)
00516 #  if defined (_STLP_WCE)
00517 #    pragma intrinsic (ceil, floor)
00518 #  endif
00519 #  pragma warning(pop)
00520 #  undef _STLP_RESTORE_FUNCTION_INTRINSIC
00521 #endif // _STLP_MSVC && _STLP_MSVC <= 1300 && !_STLP_WCE && _MSC_EXTENSIONS
00522 
00523 /* C++ Standard is unclear about several call to 'using ::func' if new overloads
00524  * of ::func appears between 2 successive 'using' calls. To avoid this potential
00525  * problem we provide all abs overload before the 'using' call.
00526  * Beware: This header inclusion has to be after all abs overload of this file.
00527  *         The first 'using ::abs' call is going to be in the other header.
00528  */
00529 #ifndef _STLP_INTERNAL_CSTDLIB
00530 #  include <stl/_cstdlib.h>
00531 #endif
00532 
00533 #if defined (_STLP_IMPORT_VENDOR_CSTD) && !defined (_STLP_NO_CSTD_FUNCTION_IMPORTS)
00534 _STLP_BEGIN_NAMESPACE
00535 using ::abs;
00536 using ::acos;
00537 using ::asin;
00538 using ::atan;
00539 using ::atan2;
00540 using ::ceil;
00541 using ::cos;
00542 using ::cosh;
00543 using ::exp;
00544 using ::fabs;
00545 using ::floor;
00546 using ::fmod;
00547 using ::frexp;
00548 /*
00549    Because of some weird interaction between STLport headers
00550    and native HP-UX headers, when compiled with _STLP_DEBUG
00551    macro defined with aC++, hypot() is not declared.
00552    At some point we'll need to get to the bottom line of
00553    this problem.
00554 */
00555 #if !(defined(__HP_aCC) && defined(_STLP_DEBUG))
00556 using ::hypot;
00557 #endif
00558 using ::ldexp;
00559 using ::log;
00560 using ::log10;
00561 using ::modf;
00562 using ::pow;
00563 using ::sin;
00564 using ::sinh;
00565 using ::sqrt;
00566 using ::tan;
00567 using ::tanh;
00568 _STLP_END_NAMESPACE
00569 #  if defined (__BORLANDC__) && (__BORLANDC__ >= 0x560) && !defined (__linux__)
00570 using _STLP_VENDOR_CSTD::_ecvt;
00571 using _STLP_VENDOR_CSTD::_fcvt;
00572 #  endif
00573 #endif
00574 
00575 #endif /* _STLP_INTERNAL_CMATH */
00576 
00577 // Local Variables:
00578 // mode:C++
00579 // End:

Generated on Sat May 26 2012 04:27:31 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.