[BASESRV]
[reactos.git] / include / c++ / cmath
index df232f8..b631fe4 100644 (file)
-//Standard C++ math declarations
-
-#pragma once
-
-#include <math.h>
-
-// Get rid of those macros defined in <math.h> in lieu of real functions.
-#undef abs
-#undef div
-#undef acos
-#undef asin
-#undef atan
-#undef atan2
-#undef ceil
-#undef cos
-#undef cosh
-#undef exp
-#undef fabs
-#undef floor
-#undef fmod
-#undef frexp
-#undef ldexp
-#undef log
-#undef log10
-#undef modf
-#undef pow
-#undef sin
-#undef sinh
-#undef sqrt
-#undef tan
-#undef tanh
-
-namespace std
-{
-  // Forward declaration of a helper function.  This really should be
-  // an `exported' forward declaration.
-  template<typename _Tp>
-    _Tp __cmath_power(_Tp, unsigned int);
-
-  template<typename _Tp>
-    inline _Tp
-    __pow_helper(_Tp __x, int __n)
-    {
-      return __n < 0
-        ? _Tp(1)/__cmath_power(__x, -__n)
-        : __cmath_power(__x, __n);
-    }
-
-  inline double
-  abs(double __x)
-  { return fabs(__x); }
-
-  inline float
-  abs(float __x)
-  { return fabsf(__x); }
-
-  inline long double
-  abs(long double __x)
-  { return fabsl(__x); }
-
-  using ::acos;
-
-  inline float
-  acos(float __x)
-  { return acosf(__x); }
-
-  inline long double
-  acos(long double __x)
-  { return acosl(__x); }
-
-  using ::asin;
-
-  inline float
-  asin(float __x)
-  { return asinf(__x); }
-
-  inline long double
-  asin(long double __x)
-  { return asinl(__x); }
-
-  using ::atan;
-
-  inline float
-  atan(float __x)
-  { return atanf(__x); }
-
-  inline long double
-  atan(long double __x)
-  { return atanl(__x); }
-
-  using ::atan2;
-
-  inline float
-  atan2(float __y, float __x)
-  { return atan2f(__y, __x); }
-
-  inline long double
-  atan2(long double __y, long double __x)
-  { return atan2l(__y, __x); }
-
-  using ::ceil;
-
-  inline float
-  ceil(float __x)
-  { return ceilf(__x); }
-
-  inline long double
-  ceil(long double __x)
-  { return ceill(__x); }
-
-  using ::cos;
-
-  inline float
-  cos(float __x)
-  { return cosf(__x); }
-
-  inline long double
-  cos(long double __x)
-  { return cosl(__x); }
-
-  using ::cosh;
-
-  inline float
-  cosh(float __x)
-  { return coshf(__x); }
-
-  inline long double
-  cosh(long double __x)
-  { return coshl(__x); }
-
-  using ::exp;
-
-  inline float
-  exp(float __x)
-  { return expf(__x); }
-
-  inline long double
-  exp(long double __x)
-  { return expl(__x); }
-
-  using ::fabs;
-
-  inline float
-  fabs(float __x)
-  { return fabsf(__x); }
-
-  inline long double
-  fabs(long double __x)
-  { return fabsl(__x); }
-
-  using ::floor;
-
-  inline float
-  floor(float __x)
-  { return floorf(__x); }
-
-  inline long double
-  floor(long double __x)
-  { return floorl(__x); }
-
-  using ::fmod;
-
-  inline float
-  fmod(float __x, float __y)
-  { return fmodf(__x, __y); }
-
-  inline long double
-  fmod(long double __x, long double __y)
-  { return fmodl(__x, __y); }
-
-  using ::frexp;
-
-  inline float
-  frexp(float __x, int* __exp)
-  { return frexpf(__x, __exp); }
-
-  inline long double
-  frexp(long double __x, int* __exp)
-  { return frexpl(__x, __exp); }
-
-  using ::ldexp;
-
-  inline float
-  ldexp(float __x, int __exp)
-  { return ldexpf(__x, __exp); }
-
-  inline long double
-  ldexp(long double __x, int __exp)
-  { return ldexpl(__x, __exp); }
-
-  using ::log;
-
-  inline float
-  log(float __x)
-  { return logf(__x); }
-
-  inline long double
-  log(long double __x)
-  { return logl(__x); }
-
-  using ::log10;
-
-  inline float
-  log10(float __x)
-  { return log10f(__x); }
-
-  inline long double
-  log10(long double __x)
-  { return log10l(__x); }
-
-  using ::modf;
-
-  inline float
-  modf(float __x, float* __iptr)
-  { return modff(__x, __iptr); }
-
-  inline long double
-  modf(long double __x, long double* __iptr)
-  { return modfl(__x, __iptr); }
-
-  using ::pow;
-
-  inline float
-  pow(float __x, float __y)
-  { return powf(__x, __y); }
-
-  inline long double
-  pow(long double __x, long double __y)
-  { return powl(__x, __y); }
-
-  inline double
-  pow(double __x, int __i)
-  { return pow(__x, static_cast<double>(__i)); }
-
-  inline float
-  pow(float __x, int __n)
-  { return powf(__x, static_cast<float>(__n)); }
-
-  inline long double
-  pow(long double __x, int __n)
-  { return powl(__x, static_cast<long double>(__n)); }
-
-  using ::sin;
-
-  inline float
-  sin(float __x)
-  { return sinf(__x); }
-
-  inline long double
-  sin(long double __x)
-  { return sinl(__x); }
-
-  using ::sinh;
-
-  inline float
-  sinh(float __x)
-  { return sinhf(__x); }
-
-  inline long double
-  sinh(long double __x)
-  { return sinhl(__x); }
-
-  using ::sqrt;
-
-  inline float
-  sqrt(float __x)
-  { return sqrtf(__x); }
-
-  inline long double
-  sqrt(long double __x)
-  { return sqrtl(__x); }
-
-  using ::tan;
-
-  inline float
-  tan(float __x)
-  { return tanf(__x); }
-
-  inline long double
-  tan(long double __x)
-  { return tanl(__x); }
-
-  using ::tanh;
-
-  inline float
-  tanh(float __x)
-  { return tanhf(__x); }
-
-  inline long double
-  tanh(long double __x)
-  { return tanhl(__x); }
-}
+//Standard C++ math declarations\r
+\r
+#pragma once\r
+\r
+#include <math.h>\r
+\r
+// Get rid of those macros defined in <math.h> in lieu of real functions.\r
+#undef abs\r
+#undef div\r
+#undef acos\r
+#undef asin\r
+#undef atan\r
+#undef atan2\r
+#undef ceil\r
+#undef cos\r
+#undef cosh\r
+#undef exp\r
+#undef fabs\r
+#undef floor\r
+#undef fmod\r
+#undef frexp\r
+#undef ldexp\r
+#undef log\r
+#undef log10\r
+#undef modf\r
+#undef pow\r
+#undef sin\r
+#undef sinh\r
+#undef sqrt\r
+#undef tan\r
+#undef tanh\r
+\r
+namespace std\r
+{\r
+  // Forward declaration of a helper function.  This really should be\r
+  // an `exported' forward declaration.\r
+  template<typename _Tp>\r
+    _Tp __cmath_power(_Tp, unsigned int);\r
+\r
+  template<typename _Tp>\r
+    inline _Tp\r
+    __pow_helper(_Tp __x, int __n)\r
+    {\r
+      return __n < 0\r
+        ? _Tp(1)/__cmath_power(__x, -__n)\r
+        : __cmath_power(__x, __n);\r
+    }\r
+\r
+  inline double\r
+  abs(double __x)\r
+  { return fabs(__x); }\r
+\r
+  inline float\r
+  abs(float __x)\r
+  { return fabsf(__x); }\r
+\r
+  inline long double\r
+  abs(long double __x)\r
+  { return fabsl(__x); }\r
+\r
+  using ::acos;\r
+\r
+  inline float\r
+  acos(float __x)\r
+  { return acosf(__x); }\r
+\r
+  inline long double\r
+  acos(long double __x)\r
+  { return acosl(__x); }\r
+\r
+  using ::asin;\r
+\r
+  inline float\r
+  asin(float __x)\r
+  { return asinf(__x); }\r
+\r
+  inline long double\r
+  asin(long double __x)\r
+  { return asinl(__x); }\r
+\r
+  using ::atan;\r
+\r
+  inline float\r
+  atan(float __x)\r
+  { return atanf(__x); }\r
+\r
+  inline long double\r
+  atan(long double __x)\r
+  { return atanl(__x); }\r
+\r
+  using ::atan2;\r
+\r
+  inline float\r
+  atan2(float __y, float __x)\r
+  { return atan2f(__y, __x); }\r
+\r
+  inline long double\r
+  atan2(long double __y, long double __x)\r
+  { return atan2l(__y, __x); }\r
+\r
+  using ::ceil;\r
+\r
+  inline float\r
+  ceil(float __x)\r
+  { return ceilf(__x); }\r
+\r
+  inline long double\r
+  ceil(long double __x)\r
+  { return ceill(__x); }\r
+\r
+  using ::cos;\r
+\r
+  inline float\r
+  cos(float __x)\r
+  { return cosf(__x); }\r
+\r
+  inline long double\r
+  cos(long double __x)\r
+  { return cosl(__x); }\r
+\r
+  using ::cosh;\r
+\r
+  inline float\r
+  cosh(float __x)\r
+  { return coshf(__x); }\r
+\r
+  inline long double\r
+  cosh(long double __x)\r
+  { return coshl(__x); }\r
+\r
+  using ::exp;\r
+\r
+  inline float\r
+  exp(float __x)\r
+  { return expf(__x); }\r
+\r
+  inline long double\r
+  exp(long double __x)\r
+  { return expl(__x); }\r
+\r
+  using ::fabs;\r
+\r
+  inline float\r
+  fabs(float __x)\r
+  { return fabsf(__x); }\r
+\r
+  inline long double\r
+  fabs(long double __x)\r
+  { return fabsl(__x); }\r
+\r
+  using ::floor;\r
+\r
+  inline float\r
+  floor(float __x)\r
+  { return floorf(__x); }\r
+\r
+  inline long double\r
+  floor(long double __x)\r
+  { return floorl(__x); }\r
+\r
+  using ::fmod;\r
+\r
+  inline float\r
+  fmod(float __x, float __y)\r
+  { return fmodf(__x, __y); }\r
+\r
+  inline long double\r
+  fmod(long double __x, long double __y)\r
+  { return fmodl(__x, __y); }\r
+\r
+  using ::frexp;\r
+\r
+  inline float\r
+  frexp(float __x, int* __exp)\r
+  { return frexpf(__x, __exp); }\r
+\r
+  inline long double\r
+  frexp(long double __x, int* __exp)\r
+  { return frexpl(__x, __exp); }\r
+\r
+  using ::ldexp;\r
+\r
+  inline float\r
+  ldexp(float __x, int __exp)\r
+  { return ldexpf(__x, __exp); }\r
+\r
+  inline long double\r
+  ldexp(long double __x, int __exp)\r
+  { return ldexpl(__x, __exp); }\r
+\r
+  using ::log;\r
+\r
+  inline float\r
+  log(float __x)\r
+  { return logf(__x); }\r
+\r
+  inline long double\r
+  log(long double __x)\r
+  { return logl(__x); }\r
+\r
+  using ::log10;\r
+\r
+  inline float\r
+  log10(float __x)\r
+  { return log10f(__x); }\r
+\r
+  inline long double\r
+  log10(long double __x)\r
+  { return log10l(__x); }\r
+\r
+  using ::modf;\r
+\r
+  inline float\r
+  modf(float __x, float* __iptr)\r
+  { return modff(__x, __iptr); }\r
+\r
+  inline long double\r
+  modf(long double __x, long double* __iptr)\r
+  { return modfl(__x, __iptr); }\r
+\r
+  using ::pow;\r
+\r
+  inline float\r
+  pow(float __x, float __y)\r
+  { return powf(__x, __y); }\r
+\r
+  inline long double\r
+  pow(long double __x, long double __y)\r
+  { return powl(__x, __y); }\r
+\r
+  inline double\r
+  pow(double __x, int __i)\r
+  { return pow(__x, static_cast<double>(__i)); }\r
+\r
+  inline float\r
+  pow(float __x, int __n)\r
+  { return powf(__x, static_cast<float>(__n)); }\r
+\r
+  inline long double\r
+  pow(long double __x, int __n)\r
+  { return powl(__x, static_cast<long double>(__n)); }\r
+\r
+  using ::sin;\r
+\r
+  inline float\r
+  sin(float __x)\r
+  { return sinf(__x); }\r
+\r
+  inline long double\r
+  sin(long double __x)\r
+  { return sinl(__x); }\r
+\r
+  using ::sinh;\r
+\r
+  inline float\r
+  sinh(float __x)\r
+  { return sinhf(__x); }\r
+\r
+  inline long double\r
+  sinh(long double __x)\r
+  { return sinhl(__x); }\r
+\r
+  using ::sqrt;\r
+\r
+  inline float\r
+  sqrt(float __x)\r
+  { return sqrtf(__x); }\r
+\r
+  inline long double\r
+  sqrt(long double __x)\r
+  { return sqrtl(__x); }\r
+\r
+  using ::tan;\r
+\r
+  inline float\r
+  tan(float __x)\r
+  { return tanf(__x); }\r
+\r
+  inline long double\r
+  tan(long double __x)\r
+  { return tanl(__x); }\r
+\r
+  using ::tanh;\r
+\r
+  inline float\r
+  tanh(float __x)\r
+  { return tanhf(__x); }\r
+\r
+  inline long double\r
+  tanh(long double __x)\r
+  { return tanhl(__x); }\r
+}\r