home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c045 / 2.ddi / INCLUDE / MATH.H$ / MATH.bin
Encoding:
Text File  |  1992-01-01  |  10.0 KB  |  326 lines

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