home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H386 / MATH.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  4KB  |  128 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /*static char *SCCSID = "@(#)math.h    6.1 90/11/16";*/
  14. /***
  15. *math.h - definitions and declarations for math library
  16. *
  17. *
  18. *Purpose:
  19. *    This file contains constant definitions and external subroutine
  20. *    declarations for the math subroutine library.
  21. *    [ANSI/System V]
  22. *
  23. ****/
  24.  
  25. #ifndef    CALLTYPE
  26. #define    CALLTYPE    _cdecl
  27. #endif    /* CALLTYPE */
  28.  
  29.  
  30. /* definition of exception struct - this struct is passed to the matherr
  31.  * routine when a floating point exception is detected
  32.  */
  33.  
  34. #ifndef _EXCEPTION_DEFINED
  35. struct exception {
  36.     int type;        /* exception type - see below */
  37.     char *name;        /* name of function where error occured */
  38.     double arg1;        /* first argument to function */
  39.     double arg2;        /* second argument (if any) to function */
  40.     double retval;        /* value to be returned by function */
  41.     } ;
  42. #define _EXCEPTION_DEFINED
  43. #endif
  44.  
  45.  
  46. /* definition of a complex struct to be used by those who use cabs and
  47.  * want type checking on their argument
  48.  */
  49.  
  50. #ifndef _COMPLEX_DEFINED
  51. struct complex {
  52.     double x,y;    /* real and imaginary parts */
  53.     } ;
  54. #define _COMPLEX_DEFINED
  55. #endif
  56.  
  57.  
  58. /* Constant definitions for the exception type passed in the exception struct
  59.  */
  60.  
  61. #define DOMAIN        1    /* argument domain error */
  62. #define SING        2    /* argument singularity */
  63. #define OVERFLOW    3    /* overflow range error */
  64. #define UNDERFLOW    4    /* underflow range error */
  65. #define TLOSS        5    /* total loss of precision */
  66. #define PLOSS        6    /* partial loss of precision */
  67.  
  68. #define EDOM        33
  69. #define ERANGE        34
  70.  
  71.  
  72. /* definitions of HUGE and HUGE_VAL - respectively the XENIX and ANSI names
  73.  * for a value returned in case of error by a number of the floating point
  74.  * math routines
  75.  */
  76.  
  77. #ifndef _DLL
  78. extern double CALLTYPE HUGE;
  79. #define HUGE_VAL HUGE
  80.  
  81. #else    /* _DLL */
  82.  
  83. #define HUGE        1.7976931348623158e+308     /* max value */
  84. #define HUGE_VAL    1.7976931348623158e+308     /* max value */
  85. #endif    /* _DLL */
  86.  
  87.  
  88. /* function prototypes */
  89.  
  90. int    _stdcall abs(int);
  91. double    CALLTYPE acos(double);
  92. double    CALLTYPE asin(double);
  93. double    CALLTYPE atan(double);
  94. double    CALLTYPE atan2(double, double);
  95. double    CALLTYPE atof(const char *);
  96. double    CALLTYPE cabs(struct complex);
  97. double    CALLTYPE ceil(double);
  98. double    CALLTYPE cos(double);
  99. double    CALLTYPE cosh(double);
  100. int    CALLTYPE dieeetomsbin(double *, double *);
  101. int    CALLTYPE dmsbintoieee(double *, double *);
  102. double    CALLTYPE exp(double);
  103. double    CALLTYPE fabs(double);
  104. int    CALLTYPE fieeetomsbin(float *, float *);
  105. double    CALLTYPE floor(double);
  106. double    CALLTYPE fmod(double, double);
  107. int    CALLTYPE fmsbintoieee(float *, float *);
  108. double    CALLTYPE frexp(double, int *);
  109. double    CALLTYPE hypot(double, double);
  110. double    CALLTYPE j0(double);
  111. double    CALLTYPE j1(double);
  112. double    CALLTYPE jn(int, double);
  113. long    _stdcall labs(long);
  114. double    CALLTYPE ldexp(double, int);
  115. double    CALLTYPE log(double);
  116. double    CALLTYPE log10(double);
  117. int    CALLTYPE matherr(struct exception *);
  118. double    CALLTYPE modf(double, double *);
  119. double    CALLTYPE pow(double, double);
  120. double    CALLTYPE sin(double);
  121. double    CALLTYPE sinh(double);
  122. double    CALLTYPE sqrt(double);
  123. double    CALLTYPE tan(double);
  124. double    CALLTYPE tanh(double);
  125. double    CALLTYPE y0(double);
  126. double    CALLTYPE y1(double);
  127. double    CALLTYPE yn(int, double);
  128.