Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenmath.h
Go to the documentation of this file.
00001 00006 #ifndef _INC_MATH 00007 #define _INC_MATH 00008 00009 #include "crtdefs.h" 00010 00011 struct exception; 00012 00013 #pragma pack(push,_CRT_PACKING) 00014 00015 #ifdef __cplusplus 00016 extern "C" { 00017 #endif 00018 00019 #ifndef _EXCEPTION_DEFINED 00020 #define _EXCEPTION_DEFINED 00021 struct _exception { 00022 int type; 00023 char *name; 00024 double arg1; 00025 double arg2; 00026 double retval; 00027 }; 00028 #endif 00029 00030 #ifndef _COMPLEX_DEFINED 00031 #define _COMPLEX_DEFINED 00032 struct _complex { 00033 double x,y; 00034 }; 00035 #endif 00036 00037 #define _DOMAIN 1 00038 #define _SING 2 00039 #define _OVERFLOW 3 00040 #define _UNDERFLOW 4 00041 #define _TLOSS 5 00042 #define _PLOSS 6 00043 #define EDOM 33 00044 #define ERANGE 34 00045 00046 _CRTIMP extern double _HUGE; 00047 00048 #define HUGE_VAL _HUGE 00049 #define _matherrl _matherr 00050 00051 #ifndef _CRT_ABS_DEFINED 00052 #define _CRT_ABS_DEFINED 00053 int __cdecl abs(int x); 00054 long __cdecl labs(long x); 00055 #endif 00056 double __cdecl acos(double x); 00057 double __cdecl asin(double x); 00058 double __cdecl atan(double x); 00059 double __cdecl atan2(double y, double x); 00060 double __cdecl cos(double x); 00061 double __cdecl cosh(double x); 00062 double __cdecl exp(double x); 00063 double __cdecl fabs(double x); 00064 double __cdecl fmod(double x, double y); 00065 double __cdecl log(double x); 00066 double __cdecl log10(double x); 00067 double __cdecl pow(double x, double y); 00068 double __cdecl sin(double x); 00069 double __cdecl sinh(double x); 00070 double __cdecl sqrt(double x); 00071 double __cdecl tan(double x); 00072 double __cdecl tanh(double x); 00073 #ifndef _CRT_MATHERR_DEFINED 00074 #define _CRT_MATHERR_DEFINED 00075 int __cdecl _matherr(struct _exception *except); 00076 #endif 00077 00078 #ifndef _CRT_ATOF_DEFINED 00079 #define _CRT_ATOF_DEFINED 00080 _CRTIMP double __cdecl atof(const char *str); 00081 _CRTIMP double __cdecl _atof_l(const char *str ,_locale_t locale); 00082 #endif 00083 #ifndef _SIGN_DEFINED 00084 #define _SIGN_DEFINED 00085 _CRTIMP double __cdecl _copysign(double x,double sgn); 00086 _CRTIMP double __cdecl _chgsign(double x); 00087 #endif 00088 _CRTIMP double __cdecl _cabs(struct _complex a); 00089 _CRTIMP double __cdecl ceil(double x); 00090 _CRTIMP double __cdecl floor(double x); 00091 _CRTIMP double __cdecl frexp(double x, int *y); 00092 _CRTIMP double __cdecl _hypot(double x, double y); 00093 _CRTIMP double __cdecl _j0(double x); 00094 _CRTIMP double __cdecl _j1(double x); 00095 _CRTIMP double __cdecl _jn(int x, double y); 00096 _CRTIMP double __cdecl ldexp(double x, int y); 00097 _CRTIMP double __cdecl modf(double x, double *y); 00098 _CRTIMP double __cdecl _y0(double x); 00099 _CRTIMP double __cdecl _y1(double x); 00100 _CRTIMP double __cdecl _yn(int x, double y); 00101 _CRTIMP float __cdecl _hypotf(float x, float y); 00102 00103 #if defined(__i386__) || defined(_M_IX86) 00104 _CRTIMP int __cdecl _set_SSE2_enable(int flag); 00105 #endif 00106 00107 #if defined(__x86_64) || defined(_M_AMD64) 00108 _CRTIMP float __cdecl _copysignf(float x, float sgn); 00109 _CRTIMP float __cdecl _chgsignf(float x); 00110 _CRTIMP float __cdecl _logbf(float x); 00111 _CRTIMP float __cdecl _nextafterf(float x,float y); 00112 _CRTIMP int __cdecl _finitef(float x); 00113 _CRTIMP int __cdecl _isnanf(float x); 00114 _CRTIMP int __cdecl _fpclassf(float x); 00115 #endif 00116 00117 #if defined(__ia64__) || defined (_M_IA64) 00118 _CRTIMP float __cdecl fabsf(float x); 00119 _CRTIMP float __cdecl ldexpf(float x, int y); 00120 _CRTIMP long double __cdecl tanl(long double x); 00121 #else 00122 __CRT_INLINE float __cdecl fabsf(float x) { return ((float)fabs((double)x)); } 00123 __CRT_INLINE float __cdecl ldexpf(float x, int expn) { return (float)ldexp (x, expn); } 00124 __CRT_INLINE long double tanl(long double x) { return (tan((double)x)); } 00125 #endif 00126 00127 #if (_WIN32_WINNT >= 0x600) && \ 00128 (defined(__x86_64) || defined(_M_AMD64) || \ 00129 defined (__ia64__) || defined (_M_IA64)) 00130 _CRTIMP float __cdecl acosf(float x); 00131 _CRTIMP float __cdecl asinf(float x); 00132 _CRTIMP float __cdecl atanf(float x); 00133 _CRTIMP float __cdecl atan2f(float x, float y); 00134 _CRTIMP float __cdecl ceilf(float x); 00135 _CRTIMP float __cdecl cosf(float x); 00136 _CRTIMP float __cdecl coshf(float x); 00137 _CRTIMP float __cdecl expf(float x); 00138 _CRTIMP float __cdecl floorf(float x); 00139 _CRTIMP float __cdecl fmodf(float x, float y); 00140 _CRTIMP float __cdecl logf(float x); 00141 _CRTIMP float __cdecl log10f(float x); 00142 _CRTIMP float __cdecl modff(float x, float *y); 00143 _CRTIMP float __cdecl powf(float b, float e); 00144 _CRTIMP float __cdecl sinf(float x); 00145 _CRTIMP float __cdecl sinhf(float x); 00146 _CRTIMP float __cdecl sqrtf(float x); 00147 _CRTIMP float __cdecl tanf(float x); 00148 _CRTIMP float __cdecl tanhf(float x); 00149 #else 00150 __CRT_INLINE float acosf(float x) { return ((float)acos((double)x)); } 00151 __CRT_INLINE float asinf(float x) { return ((float)asin((double)x)); } 00152 __CRT_INLINE float atanf(float x) { return ((float)atan((double)x)); } 00153 __CRT_INLINE float atan2f(float x,float y) { return ((float)atan2((double)x,(double)y)); } 00154 __CRT_INLINE float ceilf(float x) { return ((float)ceil((double)x)); } 00155 __CRT_INLINE float cosf(float x) { return ((float)cos((double)x)); } 00156 __CRT_INLINE float coshf(float x) { return ((float)cosh((double)x)); } 00157 __CRT_INLINE float expf(float x) { return ((float)exp((double)x)); } 00158 __CRT_INLINE float floorf(float x) { return ((float)floor((double)x)); } 00159 __CRT_INLINE float fmodf(float x,float y) { return ((float)fmod((double)x,(double)y)); } 00160 __CRT_INLINE float logf(float x) { return ((float)log((double)x)); } 00161 __CRT_INLINE float log10f(float x) { return ((float)log10((double)x)); } 00162 __CRT_INLINE float modff(float x,float *y) { 00163 double _Di,_Df = modf((double)x,&_Di); 00164 *y = (float)_Di; 00165 return ((float)_Df); 00166 } 00167 __CRT_INLINE float powf(float x,float y) { return ((float)pow((double)x,(double)y)); } 00168 __CRT_INLINE float sinf(float x) { return ((float)sin((double)x)); } 00169 __CRT_INLINE float sinhf(float x) { return ((float)sinh((double)x)); } 00170 __CRT_INLINE float sqrtf(float x) { return ((float)sqrt((double)x)); } 00171 __CRT_INLINE float tanf(float x) { return ((float)tan((double)x)); } 00172 __CRT_INLINE float tanhf(float x) { return ((float)tanh((double)x)); } 00173 #endif 00174 00175 __CRT_INLINE long double acosl(long double x) { return (acos((double)x)); } 00176 __CRT_INLINE long double asinl(long double x) { return (asin((double)x)); } 00177 __CRT_INLINE long double atanl(long double x) { return (atan((double)x)); } 00178 __CRT_INLINE long double atan2l(long double y, long double x) { return (atan2((double)y, (double)x)); } 00179 __CRT_INLINE long double ceill(long double x) { return (ceil((double)x)); } 00180 __CRT_INLINE long double cosl(long double x) { return (cos((double)x)); } 00181 __CRT_INLINE long double coshl(long double x) { return (cosh((double)x)); } 00182 __CRT_INLINE long double expl(long double x) { return (exp((double)x)); } 00183 __CRT_INLINE long double floorl(long double x) { return (floor((double)x)); } 00184 __CRT_INLINE long double fmodl(long double x, long double y) { return (fmod((double)x, (double)y)); } 00185 __CRT_INLINE long double frexpl(long double x, int *y) { return (frexp((double)x, y)); } 00186 __CRT_INLINE long double logl(long double x) { return (log((double)x)); } 00187 __CRT_INLINE long double log10l(long double x) { return (log10((double)x)); } 00188 __CRT_INLINE long double powl(long double x, long double y) { return (pow((double)x, (double)y)); } 00189 __CRT_INLINE long double sinl(long double x) { return (sin((double)x)); } 00190 __CRT_INLINE long double sinhl(long double x) { return (sinh((double)x)); } 00191 __CRT_INLINE long double sqrtl(long double x) { return (sqrt((double)x)); } 00192 __CRT_INLINE long double tanhl(long double x) {return (tanh((double)x)); } 00193 __CRT_INLINE long double __cdecl fabsl(long double x) { return fabs((double)x); } 00194 __CRT_INLINE long double _chgsignl(long double _Number) { return _chgsign((double)(_Number)); } 00195 __CRT_INLINE long double _copysignl(long double _Number, long double _Sign) { return _copysign((double)(_Number),(double)(_Sign)); } 00196 __CRT_INLINE long double _hypotl(long double x,long double y) { return _hypot((double)(x),(double)(y)); } 00197 __CRT_INLINE float frexpf(float x, int *y) { return ((float)frexp((double)x,y)); } 00198 __CRT_INLINE long double ldexpl(long double x, int y) { return ldexp((double)x, y); } 00199 __CRT_INLINE long double modfl(long double x,long double *y) { 00200 double _Di,_Df = modf((double)x,&_Di); 00201 *y = (long double)_Di; 00202 return (_Df); 00203 } 00204 00205 #ifndef NO_OLDNAMES 00206 #define DOMAIN _DOMAIN 00207 #define SING _SING 00208 #define OVERFLOW _OVERFLOW 00209 #define UNDERFLOW _UNDERFLOW 00210 #define TLOSS _TLOSS 00211 #define PLOSS _PLOSS 00212 #define matherr _matherr 00213 #define HUGE _HUGE 00214 // _CRTIMP double __cdecl cabs(struct _complex x); 00215 #define cabs _cabs 00216 _CRTIMP double __cdecl hypot(double x,double y); 00217 _CRTIMP double __cdecl j0(double x); 00218 _CRTIMP double __cdecl j1(double x); 00219 _CRTIMP double __cdecl jn(int x,double y); 00220 _CRTIMP double __cdecl y0(double x); 00221 _CRTIMP double __cdecl y1(double x); 00222 _CRTIMP double __cdecl yn(int x,double y); 00223 __CRT_INLINE float __cdecl hypotf(float x, float y) { return (float) hypot (x, y); } 00224 #endif 00225 00226 #ifdef __cplusplus 00227 } 00228 extern "C++" { 00229 template<class _Ty> inline _Ty _Pow_int(_Ty x,int y) { 00230 unsigned int _N; 00231 if(y >= 0) _N = (unsigned int)y; 00232 else _N = (unsigned int)(-y); 00233 for(_Ty _Z = _Ty(1);;x *= x) { 00234 if((_N & 1)!=0) _Z *= x; 00235 if((_N >>= 1)==0) return (y < 0 ? _Ty(1) / _Z : _Z); 00236 } 00237 } 00238 } 00239 #endif 00240 00241 #pragma pack(pop) 00242 00243 #endif /* !_INC_MATH */ 00244 00245 #if defined(_USE_MATH_DEFINES) && !defined(_MATH_DEFINES_DEFINED) 00246 #define _MATH_DEFINES_DEFINED 00247 00248 #define M_E 2.71828182845904523536 00249 #define M_LOG2E 1.44269504088896340736 00250 #define M_LOG10E 0.434294481903251827651 00251 #define M_LN2 0.693147180559945309417 00252 #define M_LN10 2.30258509299404568402 00253 #define M_PI 3.14159265358979323846 00254 #define M_PI_2 1.57079632679489661923 00255 #define M_PI_4 0.785398163397448309616 00256 #define M_1_PI 0.318309886183790671538 00257 #define M_2_PI 0.636619772367581343076 00258 #define M_2_SQRTPI 1.12837916709551257390 00259 #define M_SQRT2 1.41421356237309504880 00260 #define M_SQRT1_2 0.707106781186547524401 00261 00262 #endif /* _USE_MATH_DEFINES */ Generated on Sat May 26 2012 04:27:26 for ReactOS by
1.7.6.1
|