home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c034 / 4.ddi / INCLUDE / MATH.H$ / MATH.bin
Encoding:
Text File  |  1989-09-27  |  7.7 KB  |  236 lines

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