home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / INCLUDE / MATH.H_ / MATH.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  8.6 KB  |  304 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
  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. #ifdef _MT
  99. int __cdecl  abs(int);
  100. double  __pascal acos(double);
  101. double  __pascal asin(double);
  102. double  __pascal atan(double);
  103. double  __pascal atan2(double, double);
  104. double  __pascal atof(const char *);
  105. double  __pascal _cabs(struct _complex);
  106. double  __pascal ceil(double);
  107. double  __pascal cos(double);
  108. double  __pascal cosh(double);
  109. int __cdecl  _dieeetomsbin(double *, double *);
  110. int __cdecl  _dmsbintoieee(double *, double *);
  111. double  __pascal exp(double);
  112. double  __pascal fabs(double);
  113. int __cdecl  _fieeetomsbin(float *, float *);
  114. double  __pascal floor(double);
  115. double  __pascal fmod(double, double);
  116. int __cdecl  _fmsbintoieee(float *, float *);
  117. double  __pascal frexp(double, int *);
  118. double  __pascal _hypot(double, double);
  119. double  __pascal _j0(double);
  120. double  __pascal _j1(double);
  121. double  __pascal _jn(int, double);
  122. long    __cdecl  labs(long);
  123. double  __pascal ldexp(double, int);
  124. double  __pascal log(double);
  125. double  __pascal log10(double);
  126. int __cdecl  _matherr(struct _exception *);
  127. double  __pascal modf(double, double *);
  128. double  __pascal pow(double, double);
  129. double  __pascal sin(double);
  130. double  __pascal sinh(double);
  131. double  __pascal sqrt(double);
  132. double  __pascal tan(double);
  133. double  __pascal tanh(double);
  134. double  __pascal _y0(double);
  135. double  __pascal _y1(double);
  136. double  __pascal _yn(int, double);
  137.  
  138. #else 
  139. int __cdecl abs(int);
  140. double  __cdecl acos(double);
  141. double  __cdecl asin(double);
  142. double  __cdecl atan(double);
  143. double  __cdecl atan2(double, double);
  144. double  __cdecl atof(const char *);
  145. double  __cdecl _cabs(struct _complex);
  146. double  __cdecl ceil(double);
  147. double  __cdecl cos(double);
  148. double  __cdecl cosh(double);
  149. int __cdecl _dieeetomsbin(double *, double *);
  150. int __cdecl _dmsbintoieee(double *, double *);
  151. double  __cdecl exp(double);
  152. double  __cdecl fabs(double);
  153. int __cdecl _fieeetomsbin(float *, float *);
  154. double  __cdecl floor(double);
  155. double  __cdecl fmod(double, double);
  156. int __cdecl _fmsbintoieee(float *, float *);
  157. double  __cdecl frexp(double, int *);
  158. double  __cdecl _hypot(double, double);
  159. double  __cdecl _j0(double);
  160. double  __cdecl _j1(double);
  161. double  __cdecl _jn(int, double);
  162. long    __cdecl labs(long);
  163. double  __cdecl ldexp(double, int);
  164. double  __cdecl log(double);
  165. double  __cdecl log10(double);
  166. int __cdecl _matherr(struct _exception *);
  167. double  __cdecl modf(double, double *);
  168. double  __cdecl pow(double, double);
  169. double  __cdecl sin(double);
  170. double  __cdecl sinh(double);
  171. double  __cdecl sqrt(double);
  172. double  __cdecl tan(double);
  173. double  __cdecl tanh(double);
  174. double  __cdecl _y0(double);
  175. double  __cdecl _y1(double);
  176. double  __cdecl _yn(int, double);
  177. #endif 
  178.  
  179.  
  180. /* definition of _exceptionl struct - this struct is passed to the _matherrl
  181.  * routine when a floating point exception is detected in a long double routine
  182.  */
  183.  
  184. #ifndef _LD_EXCEPTION_DEFINED
  185. #pragma pack(2)
  186. struct _exceptionl {
  187.     int type;       /* exception type - see below */
  188.     char *name;   /* name of function where error occured */
  189.     long double arg1;   /* first argument to function */
  190.     long double arg2;   /* second argument (if any) to function */
  191.     long double retval; /* value to be returned by function */
  192.     } ;
  193. #pragma pack()
  194. #define _LD_EXCEPTION_DEFINED
  195. #endif 
  196.  
  197.  
  198. /* definition of a _complexl struct to be used by those who use _cabsl and
  199.  * want type checking on their argument
  200.  */
  201.  
  202. #ifndef _LD_COMPLEX_DEFINED
  203. #pragma pack(2)
  204. struct _complexl {
  205.     long double x,y;    /* real and imaginary parts */
  206.     } ;
  207. #pragma pack()
  208. #define _LD_COMPLEX_DEFINED
  209. #endif 
  210.  
  211. extern long double __near __cdecl _LHUGE;
  212. #define _LHUGE_VAL _LHUGE
  213.  
  214.  
  215. long double  __cdecl acosl(long double);
  216. long double  __cdecl asinl(long double);
  217. long double  __cdecl atanl(long double);
  218. long double  __cdecl atan2l(long double, long double);
  219. long double  __cdecl _atold(const char *);
  220. long double  __cdecl _cabsl(struct _complexl);
  221. long double  __cdecl ceill(long double);
  222. long double  __cdecl cosl(long double);
  223. long double  __cdecl coshl(long double);
  224. long double  __cdecl expl(long double);
  225. long double  __cdecl fabsl(long double);
  226. long double  __cdecl floorl(long double);
  227. long double  __cdecl fmodl(long double, long double);
  228. long double  __cdecl frexpl(long double, int *);
  229. long double  __cdecl _hypotl(long double, long double);
  230. long double  __cdecl _j0l(long double);
  231. long double  __cdecl _j1l(long double);
  232. long double  __cdecl _jnl(int, long double);
  233. long double  __cdecl ldexpl(long double, int);
  234. long double  __cdecl logl(long double);
  235. long double  __cdecl log10l(long double);
  236. int      __cdecl _matherrl(struct _exceptionl *);
  237. long double  __cdecl modfl(long double, long double *);
  238. long double  __cdecl powl(long double, long double);
  239. long double  __cdecl sinl(long double);
  240. long double  __cdecl sinhl(long double);
  241. long double  __cdecl sqrtl(long double);
  242. long double  __cdecl tanl(long double);
  243. long double  __cdecl tanhl(long double);
  244. long double  __cdecl _y0l(long double);
  245. long double  __cdecl _y1l(long double);
  246. long double  __cdecl _ynl(int, long double);
  247.  
  248.  
  249. #ifndef __STDC__
  250. /* Non-ANSI names for compatibility */
  251.  
  252. #define DOMAIN      _DOMAIN
  253. #define SING        _SING
  254. #define OVERFLOW    _OVERFLOW
  255. #define UNDERFLOW   _UNDERFLOW
  256. #define TLOSS       _TLOSS
  257. #define PLOSS       _PLOSS
  258.  
  259. #define matherr _matherr
  260.  
  261. extern double __near __cdecl HUGE;
  262.  
  263. #ifdef _MT
  264. #ifndef __cplusplus
  265. double  __pascal cabs(struct complex);
  266. #endif 
  267. double  __pascal hypot(double, double);
  268. double  __pascal j0(double);
  269. double  __pascal j1(double);
  270. double  __pascal jn(int, double);
  271. double  __pascal y0(double);
  272. double  __pascal y1(double);
  273. double  __pascal yn(int, double);
  274. #else 
  275. #ifndef __cplusplus
  276. double  __cdecl cabs(struct complex);
  277. #endif 
  278. double  __cdecl hypot(double, double);
  279. double  __cdecl j0(double);
  280. double  __cdecl j1(double);
  281. double  __cdecl jn(int, double);
  282. double  __cdecl y0(double);
  283. double  __cdecl y1(double);
  284. double  __cdecl yn(int, double);
  285. #endif 
  286.  
  287. int __cdecl dieeetomsbin(double *, double *);
  288. int __cdecl dmsbintoieee(double *, double *);
  289. int __cdecl fieeetomsbin(float *, float *);
  290. int __cdecl fmsbintoieee(float *, float *);
  291.  
  292. long double  __cdecl cabsl(struct _complexl);
  293. long double  __cdecl hypotl(long double, long double);
  294.  
  295. #endif 
  296.  
  297.  
  298. #ifdef __cplusplus
  299. }
  300. #endif 
  301.  
  302. #define _INC_MATH
  303. #endif 
  304.