home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 13 / DJCRX201.ZIP / include / math.h < prev    next >
C/C++ Source or Header  |  1996-09-09  |  5KB  |  186 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #ifndef __dj_include_math_h_
  3. #define __dj_include_math_h_
  4.  
  5. #ifdef _USE_LIBM_MATH_H
  6. #include <libm/math.h>
  7. #else
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  14.  
  15. extern double __dj_huge_val;
  16. #define HUGE_VAL  __dj_huge_val
  17.  
  18. double    acos(double _x);
  19. double    asin(double _x);
  20. double    atan(double _x);
  21. double    atan2(double _y, double _x);
  22. double    ceil(double _x);
  23. double    cos(double _x);
  24. double    cosh(double _x);
  25. double    exp(double _x);
  26. double    fabs(double _x);
  27. double    floor(double _x);
  28. double    fmod(double _x, double _y);
  29. double    frexp(double _x, int *_pexp);
  30. double    ldexp(double _x, int _exp);
  31. double    log(double _y);
  32. double    log10(double _x);
  33. double    modf(double _x, double *_pint);
  34. double    pow(double _x, double _y);
  35. double    sin(double _x);
  36. double    sinh(double _x);
  37. double    sqrt(double _x);
  38. double    tan(double _x);
  39. double    tanh(double _x);
  40.   
  41. #ifndef __STRICT_ANSI__
  42.  
  43. #ifndef _POSIX_SOURCE
  44.  
  45. #define M_E        2.7182818284590452354
  46. #define M_LOG2E        1.4426950408889634074
  47. #define M_LOG10E    0.43429448190325182765
  48. #define M_LN2        0.69314718055994530942
  49. #define M_LN10        2.30258509299404568402
  50. #define M_PI        3.14159265358979323846
  51. #define M_PI_2        1.57079632679489661923
  52. #define M_PI_4        0.78539816339744830962
  53. #define M_1_PI        0.31830988618379067154
  54. #define M_2_PI        0.63661977236758134308
  55. #define M_2_SQRTPI    1.12837916709551257390
  56. #define M_SQRT2        1.41421356237309504880
  57. #define M_SQRT1_2    0.70710678118654752440
  58. #define PI        M_PI
  59. #define PI2        M_PI_2
  60.  
  61. double  acosh(double _a);
  62. double  asinh(double _a);
  63. double  atanh(double _a);
  64. double    hypot(double _x, double _y);
  65. double    log2(double _x);
  66. long double modfl(long double _x, long double *_pint);
  67. double    pow10(double _x);
  68. double    pow2(double _x);
  69.  
  70. /* These are in libm.a (Cygnus).  You must link -lm to get these */
  71. /* See libm/math.h for comments */
  72.  
  73. struct exception {
  74.     int type;
  75.     char *name;
  76.     double arg1;
  77.     double arg2;
  78.     double retval;
  79. };
  80. extern double erf(double);
  81. extern double erfc(double);
  82. extern double gamma(double);
  83. extern double hypot(double, double);
  84. extern int isinf(double);
  85. extern int isnan(double);
  86. extern int finite(double);
  87. extern double j0(double);
  88. extern double j1(double);
  89. extern double jn(int, double);
  90. extern double lgamma(double);
  91. extern double y0(double);
  92. extern double y1(double);
  93. extern double yn(int, double);
  94. extern double acosh(double);
  95. extern double asinh(double);
  96. extern double atanh(double);
  97. extern double cbrt(double);
  98. extern double logb(double);
  99. extern double nextafter(double, double);
  100. extern double remainder(double, double);
  101. extern double scalb(double, double);
  102. extern int matherr(struct exception *);
  103. extern double significand(double);
  104. extern double copysign(double, double);
  105. extern int ilogb(double);
  106. extern double rint(double);
  107. extern double scalbn(double, int);
  108. extern double drem(double, double);
  109. extern double expm1(double);
  110. extern double log1p(double);
  111. #ifdef _REENTRANT
  112. extern double gamma_r(double, int *);
  113. extern double lgamma_r(double, int *);
  114. #endif /* _REENTRANT */
  115. extern float acosf(float);
  116. extern float asinf(float);
  117. extern float atanf(float);
  118. extern float atan2f(float, float);
  119. extern float cosf(float);
  120. extern float sinf(float);
  121. extern float tanf(float);
  122. extern float coshf(float);
  123. extern float sinhf(float);
  124. extern float tanhf(float);
  125. extern float expf(float);
  126. extern float frexpf(float, int *);
  127. extern float ldexpf(float, int);
  128. extern float logf(float);
  129. extern float log10f(float);
  130. extern float modff(float, float *);
  131. extern float powf(float, float);
  132. extern float sqrtf(float);
  133. extern float ceilf(float);
  134. extern float fabsf(float);
  135. extern float floorf(float);
  136. extern float fmodf(float, float);
  137. extern float erff(float);
  138. extern float erfcf(float);
  139. extern float gammaf(float);
  140. extern float hypotf(float, float);
  141. extern int isinff(float);
  142. extern int isnanf(float);
  143. extern int finitef(float);
  144. extern float j0f(float);
  145. extern float j1f(float);
  146. extern float jnf(int, float);
  147. extern float lgammaf(float);
  148. extern float y0f(float);
  149. extern float y1f(float);
  150. extern float ynf(int, float);
  151. extern float acoshf(float);
  152. extern float asinhf(float);
  153. extern float atanhf(float);
  154. extern float cbrtf(float);
  155. extern float logbf(float);
  156. extern float nextafterf(float, float);
  157. extern float remainderf(float, float);
  158. extern float scalbf(float, float);
  159. extern float significandf(float);
  160. extern float copysignf(float, float);
  161. extern int ilogbf(float);
  162. extern float rintf(float);
  163. extern float scalbnf(float, int);
  164. extern float dremf(float, float);
  165. extern float expm1f(float);
  166. extern float log1pf(float);
  167. #ifdef _REENTRANT
  168. extern float gammaf_r(float, int *);
  169. extern float lgammaf_r(float, int *);
  170. #endif    /* _REENTRANT */
  171.  
  172. #endif /* !_POSIX_SOURCE */
  173. #endif /* !__STRICT_ANSI__ */
  174. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  175.  
  176. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  177. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  178.  
  179. #ifdef __cplusplus
  180. }
  181. #endif
  182.  
  183. #endif /* _USE_LIBM_MATH_H */
  184.  
  185. #endif /* !__dj_include_math_h_ */
  186.