home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / TURBOC_1.LZH / INCLUDE / MATH.H < prev    next >
Text File  |  1990-03-02  |  3KB  |  97 lines

  1. /*      MATH.H
  2.  
  3.         Mathematical Definition Includes
  4.  
  5.         Copyright (c) Borland International 1988
  6.         All Rights Reserved.
  7. */
  8.  
  9.  
  10. #if !defined( __MATH )
  11. #define __MATH
  12.  
  13. #define HUGE_VAL    1.189731495357231765E+4932
  14.  
  15. #define M_E            2.71828182845904523536
  16. #define M_LOG2E        1.44269504088896340736
  17. #define M_LOG10E    0.434294481903251827651
  18. #define M_LN2        0.693147180559945309417
  19. #define M_LN10        2.30258509299404568402
  20. #define M_PI        3.14159265358979323846
  21. #define M_PI_2        1.57079632679489661923
  22. #define M_PI_4        0.785398163397448309116
  23. #define M_1_PI        0.318309886183790671538
  24. #define M_2_PI        0.636619772367581343076
  25. #define M_1_SQRTPI    0.564189583547756286948
  26. #define M_2_SQRTPI    1.12837916709551257390
  27. #define M_SQRT2        1.41421356237309504880
  28. #define M_SQRT_2    0.707106781186547524401
  29.  
  30. double  fabs( double x );
  31. double  ceil( double x );
  32. double  floor( double x );
  33. double  round( double x );
  34. double  trunc( double x );
  35. double  fmod( double x, double y );
  36.  
  37. double  exp( double x );
  38. double  log( double x );
  39. double  log10( double x );
  40.  
  41. double  frexp( double x, int *nptr );
  42. double  ldexp( double x, int n );
  43. double  modf( double x, double *nptr );
  44.  
  45. double  pow( double x, double y );
  46. double  pow10( int i );
  47. double  sqrt( double x );
  48.  
  49. double  cos( double x );
  50. double  sin( double x );
  51. double  tan( double x );
  52.  
  53. double  acos( double x );
  54. double  asin( double x );
  55. double  atan( double x );
  56. double  atan2( double x, double y );
  57. double  cosh( double x );
  58. double  sinh( double x );
  59. double  tanh( double x );
  60.  
  61. double  acosh( double x );
  62. double  asinh( double x );
  63. double  atanh( double x );
  64.  
  65. int     ftoa( double *x, char *resStr, int ndig, int format,
  66.               int *decPnt, int *sign );
  67.  
  68. double  atof( const char *digStr );
  69.  
  70.  
  71. typedef enum
  72. {
  73.          DOMAIN = 1,    /* argument domain error -- log (-1)      */
  74.          SING,          /* argument singularity  -- pow (0,-2))   */
  75.          OVERFLOW,      /* overflow range error  -- exp (1000)    */
  76.          UNDERFLOW      /* underflow range error -- exp (-1000)   */
  77. } mexcep;
  78.  
  79. struct exception
  80. {
  81.     mexcep      type;
  82.     char        *name;
  83.     double      arg1;
  84.     double      arg2;
  85.     double      retval;
  86. };
  87.  
  88.  
  89. void    setmatherr( int (*errorfunc)( struct exception *e ) );
  90. int     fpumode( int disable );
  91. void    xdcnv( double *val, void *rep8bytes );
  92. void    dxcnv( void *rep8bytes, double *val );
  93.  
  94. #endif
  95.  
  96. /************************************************************************/
  97.