Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

303 lines
8.6 KiB

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