home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c031 / 4.ddi / INCLUDE / MATH.H$ / MATH
Encoding:
Text File  |  1991-11-06  |  6.8 KB  |  249 lines

  1. /***
  2. *math.h - definitions and declarations for math library
  3. *
  4. *    Copyright (c) 1985-1992, 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. #if (_MSC_VER <= 600)
  20. #define __cdecl     _cdecl
  21. #define __far       _far
  22. #define __near      _near
  23. #define __pascal    _pascal
  24. #endif
  25.  
  26. /* definition of _exception struct - this struct is passed to the _matherr
  27.  * routine when a floating point exception is detected
  28.  */
  29.  
  30. #ifndef _EXCEPTION_DEFINED
  31. #pragma pack(2)
  32.  
  33. struct _exception {
  34.     int type;        /* exception type - see below */
  35.     char *name;    /* name of function where error occured */
  36.     double arg1;        /* first argument to function */
  37.     double arg2;        /* second argument (if any) to function */
  38.     double retval;        /* value to be returned by function */
  39.     } ;
  40.  
  41. #ifndef __STDC__
  42. /* Non-ANSI name for compatibility */
  43. #define exception _exception
  44. #endif
  45.  
  46. #pragma pack()
  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.  
  57. struct _complex {
  58.     double x,y;    /* real and imaginary parts */
  59.     } ;
  60.  
  61. #ifndef __cplusplus        /* avoid "complex" name collision */
  62. #ifndef __STDC__
  63. /* Non-ANSI name for compatibility */
  64. struct complex {
  65.     double x,y;    /* real and imaginary parts */
  66.     } ;
  67. #endif
  68. #endif
  69.  
  70. #define _COMPLEX_DEFINED
  71. #endif
  72.  
  73.  
  74. /* Constant definitions for the exception type passed in the _exception struct
  75.  */
  76.  
  77. #define _DOMAIN     1    /* argument domain error */
  78. #define _SING        2    /* argument singularity */
  79. #define _OVERFLOW    3    /* overflow range error */
  80. #define _UNDERFLOW    4    /* underflow range error */
  81. #define _TLOSS        5    /* total loss of precision */
  82. #define _PLOSS        6    /* partial loss of precision */
  83.  
  84. #define EDOM        33
  85. #define ERANGE        34
  86.  
  87.  
  88. /* definitions of _HUGE (XENIX) and HUGE_VAL (ANSI) error return values used
  89.  * by several floating point math routines
  90.  */
  91.  
  92. extern double __near __cdecl _HUGE;
  93. #define HUGE_VAL _HUGE
  94.  
  95.  
  96. /* function prototypes */
  97.  
  98. int    __cdecl abs(int);
  99. double    __cdecl acos(double);
  100. double    __cdecl asin(double);
  101. double    __cdecl atan(double);
  102. double    __cdecl atan2(double, double);
  103. double    __cdecl atof(const char *);
  104. double    __cdecl _cabs(struct _complex);
  105. double    __cdecl ceil(double);
  106. double    __cdecl cos(double);
  107. double    __cdecl cosh(double);
  108. int    __cdecl _dieeetomsbin(double *, double *);
  109. int    __cdecl _dmsbintoieee(double *, double *);
  110. double    __cdecl exp(double);
  111. double    __cdecl fabs(double);
  112. int    __cdecl _fieeetomsbin(float *, float *);
  113. double    __cdecl floor(double);
  114. double    __cdecl fmod(double, double);
  115. int    __cdecl _fmsbintoieee(float *, float *);
  116. double    __cdecl frexp(double, int *);
  117. double    __cdecl _hypot(double, double);
  118. double    __cdecl _j0(double);
  119. double    __cdecl _j1(double);
  120. double    __cdecl _jn(int, double);
  121. long    __cdecl labs(long);
  122. double    __cdecl ldexp(double, int);
  123. double    __cdecl log(double);
  124. double    __cdecl log10(double);
  125. int    __cdecl _matherr(struct _exception *);
  126. double    __cdecl modf(double, double *);
  127. double    __cdecl pow(double, double);
  128. double    __cdecl sin(double);
  129. double    __cdecl sinh(double);
  130. double    __cdecl sqrt(double);
  131. double    __cdecl tan(double);
  132. double    __cdecl tanh(double);
  133. double    __cdecl _y0(double);
  134. double    __cdecl _y1(double);
  135. double    __cdecl _yn(int, double);
  136.  
  137.  
  138. /* definition of _exceptionl struct - this struct is passed to the _matherrl
  139.  * routine when a floating point exception is detected in a long double routine
  140.  */
  141.  
  142. #ifndef _LD_EXCEPTION_DEFINED
  143. #pragma pack(2)
  144. struct _exceptionl {
  145.     int type;        /* exception type - see below */
  146.     char *name;    /* name of function where error occured */
  147.     long double arg1;    /* first argument to function */
  148.     long double arg2;    /* second argument (if any) to function */
  149.     long double retval;    /* value to be returned by function */
  150.     } ;
  151. #pragma pack()
  152. #define _LD_EXCEPTION_DEFINED
  153. #endif
  154.  
  155.  
  156. /* definition of a _complexl struct to be used by those who use _cabsl and
  157.  * want type checking on their argument
  158.  */
  159.  
  160. #ifndef _LD_COMPLEX_DEFINED
  161. #pragma pack(2)
  162. struct _complexl {
  163.     long double x,y;    /* real and imaginary parts */
  164.     } ;
  165. #pragma pack()
  166. #define _LD_COMPLEX_DEFINED
  167. #endif
  168.  
  169. extern long double __near __cdecl _LHUGE;
  170. #define _LHUGE_VAL _LHUGE
  171.  
  172.  
  173. long double  __cdecl acosl(long double);
  174. long double  __cdecl asinl(long double);
  175. long double  __cdecl atanl(long double);
  176. long double  __cdecl atan2l(long double, long double);
  177. long double  __cdecl _atold(const char *);
  178. long double  __cdecl _cabsl(struct _complexl);
  179. long double  __cdecl ceill(long double);
  180. long double  __cdecl cosl(long double);
  181. long double  __cdecl coshl(long double);
  182. long double  __cdecl expl(long double);
  183. long double  __cdecl fabsl(long double);
  184. long double  __cdecl floorl(long double);
  185. long double  __cdecl fmodl(long double, long double);
  186. long double  __cdecl frexpl(long double, int *);
  187. long double  __cdecl _hypotl(long double, long double);
  188. long double  __cdecl _j0l(long double);
  189. long double  __cdecl _j1l(long double);
  190. long double  __cdecl _jnl(int, long double);
  191. long double  __cdecl ldexpl(long double, int);
  192. long double  __cdecl logl(long double);
  193. long double  __cdecl log10l(long double);
  194. int         __cdecl _matherrl(struct _exceptionl *);
  195. long double  __cdecl modfl(long double, long double *);
  196. long double  __cdecl powl(long double, long double);
  197. long double  __cdecl sinl(long double);
  198. long double  __cdecl sinhl(long double);
  199. long double  __cdecl sqrtl(long double);
  200. long double  __cdecl tanl(long double);
  201. long double  __cdecl tanhl(long double);
  202. long double  __cdecl _y0l(long double);
  203. long double  __cdecl _y1l(long double);
  204. long double  __cdecl _ynl(int, long double);
  205.  
  206.  
  207. #ifndef __STDC__
  208. /* Non-ANSI names for compatibility */
  209.  
  210. #define DOMAIN        _DOMAIN
  211. #define SING        _SING
  212. #define OVERFLOW    _OVERFLOW
  213. #define UNDERFLOW    _UNDERFLOW
  214. #define TLOSS        _TLOSS
  215. #define PLOSS        _PLOSS
  216.  
  217. #define matherr _matherr
  218.  
  219. extern double __near __cdecl HUGE;
  220.  
  221. #ifndef __cplusplus        /* avoid "complex" name collision */
  222. double    __cdecl cabs(struct complex);
  223. #endif
  224. double    __cdecl hypot(double, double);
  225. double    __cdecl j0(double);
  226. double    __cdecl j1(double);
  227. double    __cdecl jn(int, double);
  228. double    __cdecl y0(double);
  229. double    __cdecl y1(double);
  230. double    __cdecl yn(int, double);
  231.  
  232. int    __cdecl dieeetomsbin(double *, double *);
  233. int    __cdecl dmsbintoieee(double *, double *);
  234. int    __cdecl fieeetomsbin(float *, float *);
  235. int    __cdecl fmsbintoieee(float *, float *);
  236.  
  237. long double  __cdecl cabsl(struct _complexl);
  238. long double  __cdecl hypotl(long double, long double);
  239.  
  240. #endif    /* __STDC__ */
  241.  
  242.  
  243. #ifdef __cplusplus
  244. }
  245. #endif
  246.  
  247. #define _INC_MATH
  248. #endif    /* _INC_MATH */
  249.