home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c329 / 2.img / INCL / MATH.H < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-05  |  2.2 KB  |  75 lines

  1. /*
  2.  *    math.h
  3.  *
  4.  *    Copyright (C) MicroWay, Inc., 1987, 1988, 1989
  5.  *
  6.  */
  7.  
  8.  
  9. #ifdef i386
  10. # define LittleEndian
  11. # define ieee_float
  12. #endif
  13.  
  14.  
  15. #define LIBM_PI    3.14159265358979323846
  16. #define PI    3.14159265358979323846
  17.  
  18.  
  19. double    acos(), sqrt(), atan(), asin(), atan2(), j0(), sin(), cos(), y0(),
  20.     log(), j1(), y1(), jn(), yn(), erf(), erfc(), exp(), gamma(),
  21.     sinh(), cosh(), tanh(), log10(), pow(), tan(), atof(), ldexp(),
  22.     frexp(), modf(), ceil(), floor(), hypot(), fabs(), cabs(), fmod();
  23.  
  24. double    d_abs(), d_dim(), d_imag(), d_int(), d_mod(), d_nint(),
  25.     d_prod(), d_sign(), pow_di(), pow_dd(), z_abs();
  26.  
  27. float    rldexp();
  28. float    racos(), rasin(), ratan(), ratan2(), rcos(), rexp(), rlog(),
  29.     rlog10(), rsin(), rsqrt(), rtan();
  30.  
  31. char    *ecvt(), *fcvt(), *gcvt();
  32.  
  33. float    besj0(), besj1(), besjn(), besy0(), besy1(), besyn();
  34. float    c_abs(), pow_ri(), pow_rr(), r_abs(), r_dim(), r_imag(), r_int(),
  35.     r_mod(), r_nint(), r_sign(), r_sinh(), r_tanh();
  36.  
  37.  
  38. /* Degree style trigonometric functions. */
  39.  
  40. float    rsind(), rcosd(), rtand(), rasind(), racosd(), ratand(), ratan2d(),
  41.     r_sind(), r_cosd(), r_tand(), r_acosd(), r_asind(), r_atand(),
  42.     r_atn2d(), ran_();
  43.  
  44. double    sind(), cosd(), tand(), asind(), acosd(), atand(), atan2d(),
  45.     d_sind(), d_cosd(), d_tand(), d_acosd(), d_asind(), d_atand(),
  46.     d_atn2d();
  47.     
  48.  
  49. typedef struct {
  50.     unsigned long dbl_frac2 : 32;
  51.     unsigned long dbl_frac1 : 20;
  52.     unsigned long dbl_exp : 11;
  53.     unsigned long dbl_sign : 1;
  54. } DOUBLE;
  55. typedef struct {
  56.     unsigned long flt_frac1 : 23;
  57.     unsigned long flt_exp : 8;
  58.     unsigned long flt_sign : 1;
  59. } FLOAT;
  60.  
  61.  
  62. #define KNOWN_FLOATING_POINT_FORMAT    1
  63. #define EXTRACTEXPONENT(x)    ((int)((DOUBLE *)&(x))->dbl_exp-1022)
  64. #define EXTRACTFLOATEXPONENT(x)    ((int)((FLOAT *)&(x))->flt_exp-126)
  65. #define SETEXPONENT(x,exp)    (((DOUBLE *)&(x))->dbl_exp = ((exp)+1022))
  66. #define SETFLOATEXPONENT(x,exp)    (((FLOAT *)&(x))->flt_exp = ((exp)+126))
  67. #define AUGMENTEXPONENT(x, inc) (((DOUBLE *)&(x))->dbl_exp += (inc))
  68. #define AUGMENTFLOATEXPONENT(x, inc) (*((int *)(&x)) += (inc << 23))
  69. #define MINIMUMEXPONENT        -1021
  70. #define MINIMUMFLOATEXPONENT    -125
  71. #define MAXIMUMEXPONENT        1024
  72. #define MAXIMUMFLOATEXPONENT    128
  73. #define HUGE            (1.7e308)
  74. #define HUGEFLOAT        (3.4e38)
  75.