home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Languages / Quick C 2.0 / INCLUDE / MATH.H < prev    next >
Encoding:
C/C++ Source or Header  |  1988-12-05  |  3.1 KB  |  115 lines

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