Source code of Windows XP (NT5)
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.

112 lines
3.1 KiB

  1. /***
  2. *math.h - definitions and declarations for math library
  3. *
  4. * Copyright (c) 1985-1988, 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 NO_EXT_KEYS /* extensions enabled */
  13. #define _CDECL cdecl
  14. #else /* extensions not enabled */
  15. #define _CDECL
  16. #endif /* NO_EXT_KEYS */
  17. /* definition of exception struct - this struct is passed to the matherr
  18. * routine when a floating point exception is detected
  19. */
  20. #ifndef _EXCEPTION_DEFINED
  21. struct exception {
  22. int type; /* exception type - see below */
  23. char *name; /* name of function where error occured */
  24. double arg1; /* first argument to function */
  25. double arg2; /* second argument (if any) to function */
  26. double retval; /* value to be returned by function */
  27. } ;
  28. #define _EXCEPTION_DEFINED
  29. #endif
  30. /* definition of a complex struct to be used by those who use cabs and
  31. * want type checking on their argument
  32. */
  33. #ifndef _COMPLEX_DEFINED
  34. struct complex {
  35. double x,y; /* real and imaginary parts */
  36. } ;
  37. #define _COMPLEX_DEFINED
  38. #endif
  39. /* Constant definitions for the exception type passed in the exception struct
  40. */
  41. #define DOMAIN 1 /* argument domain error */
  42. #define SING 2 /* argument singularity */
  43. #define OVERFLOW 3 /* overflow range error */
  44. #define UNDERFLOW 4 /* underflow range error */
  45. #define TLOSS 5 /* total loss of precision */
  46. #define PLOSS 6 /* partial loss of precision */
  47. #define EDOM 33
  48. #define ERANGE 34
  49. /* definitions of HUGE and HUGE_VAL - respectively the XENIX and ANSI names
  50. * for a value returned in case of error by a number of the floating point
  51. * math routines
  52. */
  53. extern double HUGE;
  54. #define HUGE_VAL HUGE
  55. /* function prototypes */
  56. int _CDECL abs(int);
  57. double _CDECL acos(double);
  58. double _CDECL asin(double);
  59. double _CDECL atan(double);
  60. double _CDECL atan2(double, double);
  61. double _CDECL atof(const char *);
  62. double _CDECL cabs(struct complex);
  63. double _CDECL ceil(double);
  64. double _CDECL cos(double);
  65. double _CDECL cosh(double);
  66. int _CDECL dieeetomsbin(double *, double *);
  67. int _CDECL dmsbintoieee(double *, double *);
  68. double _CDECL exp(double);
  69. double _CDECL fabs(double);
  70. int _CDECL fieeetomsbin(float *, float *);
  71. double _CDECL floor(double);
  72. double _CDECL fmod(double, double);
  73. int _CDECL fmsbintoieee(float *, float *);
  74. double _CDECL frexp(double, int *);
  75. double _CDECL hypot(double, double);
  76. double _CDECL j0(double);
  77. double _CDECL j1(double);
  78. double _CDECL jn(int, double);
  79. long _CDECL labs(long);
  80. double _CDECL ldexp(double, int);
  81. double _CDECL log(double);
  82. double _CDECL log10(double);
  83. int _CDECL matherr(struct exception *);
  84. double _CDECL modf(double, double *);
  85. double _CDECL pow(double, double);
  86. double _CDECL sin(double);
  87. double _CDECL sinh(double);
  88. double _CDECL sqrt(double);
  89. double _CDECL tan(double);
  90. double _CDECL tanh(double);
  91. double _CDECL y0(double);
  92. double _CDECL y1(double);
  93. double _CDECL yn(int, double);