home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / math.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  6.4 KB  |  221 lines

  1. /***
  2. *math.h - definitions and declarations for math library
  3. *
  4. *    Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *    This file contains constant definitions and external subroutine
  8. *    declarations for the math subroutine library.
  9. *    [ANSI/System V]
  10. *
  11. ****/
  12.  
  13. #ifndef _INC_MATH
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19.  
  20. #ifndef _CRTIMP
  21. #ifdef _DLL
  22. #define _CRTIMP __declspec(dllimport)
  23. #else
  24. #define _CRTIMP
  25. #endif
  26. #endif
  27.  
  28.  
  29. /* definition of _exception struct - this struct is passed to the matherr
  30.  * routine when a floating point exception is detected
  31.  */
  32.  
  33. #ifndef _EXCEPTION_DEFINED
  34. struct _exception {
  35.     int type;        /* exception type - see below */
  36.     char *name;        /* name of function where error occured */
  37.     double arg1;        /* first argument to function */
  38.     double arg2;        /* second argument (if any) to function */
  39.     double retval;        /* value to be returned by function */
  40.     } ;
  41.  
  42. #if !__STDC__
  43. /* Non-ANSI name for compatibility */
  44. #define exception _exception
  45. #endif
  46.  
  47. #define _EXCEPTION_DEFINED
  48. #endif
  49.  
  50.  
  51. /* definition of a _complex struct to be used by those who use cabs and
  52.  * want type checking on their argument
  53.  */
  54.  
  55. #ifndef _COMPLEX_DEFINED
  56. struct _complex {
  57.     double x,y;    /* real and imaginary parts */
  58.     } ;
  59.  
  60. #if !__STDC__
  61. /* Non-ANSI name for compatibility */
  62. #define complex _complex
  63. #endif
  64.  
  65. #define _COMPLEX_DEFINED
  66. #endif
  67.  
  68.  
  69. /* Constant definitions for the exception type passed in the _exception struct
  70.  */
  71.  
  72. #define _DOMAIN     1    /* argument domain error */
  73. #define _SING        2    /* argument singularity */
  74. #define _OVERFLOW    3    /* overflow range error */
  75. #define _UNDERFLOW    4    /* underflow range error */
  76. #define _TLOSS        5    /* total loss of precision */
  77. #define _PLOSS        6    /* partial loss of precision */
  78.  
  79. #define EDOM        33
  80. #define ERANGE        34
  81.  
  82.  
  83. /* definitions of _HUGE and HUGE_VAL - respectively the XENIX and ANSI names
  84.  * for a value returned in case of error by a number of the floating point
  85.  * math routines
  86.  */
  87. _CRTIMP extern double _HUGE;
  88.  
  89. #define HUGE_VAL _HUGE
  90.  
  91. /* function prototypes */
  92.  
  93. #ifndef UNDER_CE
  94. _CRTIMP double    __cdecl atof(const char *);
  95. #endif    /* UNDER_CE */
  96.  
  97. #ifndef _INC_STDLIB
  98. #ifndef abs
  99. _CRTIMP int    __cdecl abs(int);
  100. #endif
  101. _CRTIMP long    __cdecl labs(long);
  102. #endif
  103.     double    __cdecl acos(double);
  104.     double    __cdecl asin(double);
  105.     double    __cdecl atan(double);
  106.     double    __cdecl atan2(double, double);
  107. _CRTIMP double    __cdecl _cabs(struct _complex);
  108. _CRTIMP double    __cdecl ceil(double);
  109.     double    __cdecl cos(double);
  110.     double    __cdecl cosh(double);
  111.     double    __cdecl exp(double);
  112.     double    __cdecl fabs(double);
  113. _CRTIMP double    __cdecl floor(double);
  114.     double    __cdecl fmod(double, double);
  115. _CRTIMP double    __cdecl frexp(double, int *);
  116. _CRTIMP double    __cdecl _hypot(double, double);
  117. _CRTIMP double    __cdecl _j0(double);
  118. _CRTIMP double    __cdecl _j1(double);
  119. _CRTIMP double    __cdecl _jn(int, double);
  120. _CRTIMP double    __cdecl ldexp(double, int);
  121.     double    __cdecl log(double);
  122.     double    __cdecl log10(double);
  123. _CRTIMP int    __cdecl _matherr(struct _exception *);
  124. _CRTIMP double    __cdecl modf(double, double *);
  125.     double    __cdecl pow(double, double);
  126.     double    __cdecl sin(double);
  127.     double    __cdecl sinh(double);
  128.     double    __cdecl sqrt(double);
  129.     double    __cdecl tan(double);
  130.     double    __cdecl tanh(double);
  131. _CRTIMP double    __cdecl _y0(double);
  132. _CRTIMP double    __cdecl _y1(double);
  133. _CRTIMP double    __cdecl _yn(int, double);
  134.  
  135. #define acosl(x)    ((long double)acos((double)(x)))
  136. #define asinl(x)    ((long double)asin((double)(x)))
  137. #define atanl(x)    ((long double)atan((double)(x)))
  138. #define atan2l(x,y)    ((long double)atan2((double)(x), (double)(y)))
  139. #define ceill(x)    ((long double)ceil((double)(x)))
  140. #define cosl(x)        ((long double)cos((double)(x)))
  141. #define coshl(x)    ((long double)cosh((double)(x)))
  142. #define expl(x)        ((long double)exp((double)(x)))
  143. #define fabsl(x)    ((long double)fabs((double)(x)))
  144. #define floorl(x)    ((long double)floor((double)(x)))
  145. #define fmodl(x,y)    ((long double)fmod((double)(x), (double)(y)))
  146. #define frexpl(x,y)    ((long double)frexp((double)(x), (y)))
  147. #define _hypotl(x,y)    ((long double)_hypot((double)(x), (double)(y)))
  148. #define hypotl(x,y)     ((long double)hypot((double)(x), (double)(y)))
  149. #define ldexpl(x,y)    ((long double)ldexp((double)(x), (y)))
  150. #define logl(x)        ((long double)log((double)(x)))
  151. #define log10l(x)    ((long double)log10((double)(x)))
  152. #define _matherrl    _matherr
  153. #define modfl(x,y)    ((long double)modf((double)(x), (double *)(y)))
  154. #define powl(x,y)    ((long double)pow((double)(x), (double)(y)))
  155. #define sinl(x)        ((long double)sin((double)(x)))
  156. #define sinhl(x)    ((long double)sinh((double)(x)))
  157. #define sqrtl(x)    ((long double)sqrt((double)(x)))
  158. #define tanl(x)        ((long double)tan((double)(x)))
  159. #define tanhl(x)    ((long double)tanh((double)(x)))
  160.  
  161. #if defined(_M_MRX000)
  162. /* MIPS fast prototypes for float */
  163. _CRTIMP float  __cdecl acosf( float );
  164. _CRTIMP float  __cdecl asinf( float );
  165. _CRTIMP float  __cdecl atanf( float );
  166. _CRTIMP float  __cdecl atan2f( float , float );
  167. _CRTIMP float  __cdecl cosf( float );
  168. _CRTIMP float  __cdecl sinf( float );
  169. _CRTIMP float  __cdecl tanf( float );
  170. _CRTIMP float  __cdecl coshf( float );
  171. _CRTIMP float  __cdecl sinhf( float );
  172. _CRTIMP float  __cdecl tanhf( float );
  173. _CRTIMP float  __cdecl expf( float );
  174. _CRTIMP float  __cdecl logf( float );
  175. _CRTIMP float  __cdecl log10f( float );
  176. _CRTIMP float  __cdecl modff( float , float* );
  177. _CRTIMP    float  __cdecl ldexpf(float, int);
  178. _CRTIMP float  __cdecl powf( float , float );
  179.         float  __cdecl sqrtf( float );
  180.         float  __cdecl ceilf( float );
  181.         float  __cdecl fabsf( float );
  182.         float  __cdecl floorf( float );
  183. _CRTIMP float  __cdecl fmodf( float , float );
  184. _CRTIMP float  __cdecl hypotf(float, float);
  185. #endif
  186.  
  187. #if !__STDC__
  188. /* Non-ANSI names for compatibility */
  189.  
  190. #define DOMAIN        _DOMAIN
  191. #define SING        _SING
  192. #define OVERFLOW    _OVERFLOW
  193. #define UNDERFLOW    _UNDERFLOW
  194. #define TLOSS        _TLOSS
  195. #define PLOSS        _PLOSS
  196.  
  197. #define matherr     _matherr
  198.  
  199. _CRTIMP extern double HUGE;
  200.  
  201. #ifndef UNDER_CE
  202. _CRTIMP double    __cdecl cabs(struct complex);
  203. _CRTIMP double    __cdecl hypot(double, double);
  204. _CRTIMP double    __cdecl j0(double);
  205. _CRTIMP double    __cdecl j1(double);
  206. _CRTIMP double    __cdecl jn(int, double);
  207. _CRTIMP double    __cdecl y0(double);
  208. _CRTIMP double    __cdecl y1(double);
  209. _CRTIMP double    __cdecl yn(int, double);
  210. #endif
  211.  
  212.  
  213. #endif    /* __STDC__ */
  214.  
  215. #ifdef __cplusplus
  216. }
  217. #endif
  218.  
  219. #define _INC_MATH
  220. #endif    /* _INC_MATH */
  221.