home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / g__lib / math.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-23  |  4.1 KB  |  189 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. /* 
  3. Copyright (C) 1988 Free Software Foundation
  4.     written by Doug Lea (dl@rocky.oswego.edu)
  5.  
  6. This file is part of GNU CC.
  7.  
  8. GNU CC is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY.  No author or distributor
  10. accepts responsibility to anyone for the consequences of using it
  11. or for whether it serves any particular purpose or works at all,
  12. unless he says so in writing.  Refer to the GNU CC General Public
  13. License for full details.
  14.  
  15. Everyone is granted permission to copy, modify and redistribute
  16. GNU CC, but only under the conditions described in the
  17. GNU CC General Public License.   A copy of this license is
  18. supposed to have been given to you along with GNU CC so you
  19. can know your rights and responsibilities.  It should be in a
  20. file named COPYING.  Among other things, the copyright notice
  21. and this notice must be preserved on all copies.  
  22. */
  23.  
  24.  
  25. #ifndef _math_h
  26. #pragma once
  27. #define _math_h 1
  28.  
  29. overload acos;
  30. overload acosh;
  31. overload asin;
  32. overload asinh;
  33. overload atan2;
  34. overload atanh;
  35. overload ceil;
  36. overload cos;
  37. overload cosh;
  38. overload exp;
  39. overload floor;
  40. overload gamma;
  41. overload hypot;
  42. overload log;
  43. overload log10;
  44. overload pow;
  45. overload sin;
  46. overload sinh;
  47. overload sqrt;
  48. overload tan;
  49. overload tanh;
  50.  
  51. extern "C" {
  52.  
  53. double  acos(double);
  54. double  acosh(double);
  55. double  asin(double);
  56. double  asinh(double);
  57. double  atan(double);
  58. double  atan2(double, double);
  59. double  atanh(double);
  60. double  cbrt(double);
  61. double  ceil(double);
  62. double  copysign(double,double);
  63. double  cos(double);
  64. double  cosh(double);
  65. double  drem(double,double);
  66. double  erf(double);
  67. double  erfc(double);
  68. double  exp(double);
  69. double  expm1(double);
  70. double  fabs(double);
  71. double  finite(double);
  72. double  floor(double);
  73. double  frexp(double, int*);
  74. double  gamma(double);
  75. double  hypot(double,double);
  76. double  infnan(int);
  77. int     isinf(double);
  78. int     isnan(double);
  79. double  j0(double);
  80. double  j1(double);
  81. double  jn(int, double);
  82. double  ldexp(double, int);
  83. double  lgamma(double);
  84. double  log(double);
  85. double  log10(double);
  86. double  log1p(double);
  87. double  logb(double);
  88. double  modf(double, double*);
  89. double  pow(double, double);
  90. double  rint(double);
  91. double  scalb(double, int);
  92. double  sin(double);
  93. double  sinh(double);
  94. double  sqrt(double);
  95. double  tan(double);
  96. double  tanh(double);
  97. double  y0(double);
  98. double  y1(double);
  99. double  yn(int, double);
  100.  
  101. }
  102.  
  103. /* libg++ doesn't use this since it is not available on some systems */
  104.  
  105. /* the following ifdef is just for compiling OOPS */
  106.  
  107. #ifndef DONT_DECLARE_EXCEPTION
  108. struct exception
  109. {
  110.   int type;
  111.   char* name;
  112.   double arg1, arg2, retval;
  113. };
  114.  
  115. #define DOMAIN      1
  116. #define SING        2
  117. #define OVERFLOW    3
  118. #define UNDERFLOW   4
  119. #define TLOSS       5
  120. #define PLOSS       6
  121.  
  122. extern "C" int matherr(exception*);
  123.  
  124. #endif
  125.  
  126. #include <values.h>
  127.  
  128. /* On some systems, HUGE ought to be MAXFLOAT or IEEE infinity */
  129.  
  130. #ifndef HUGE
  131. #define HUGE    MAXDOUBLE
  132. #endif
  133.  
  134. /* These seem to be sun & sysV names of these constants */
  135.  
  136. #ifndef M_E
  137. #define M_E         2.7182818284590452354
  138. #endif
  139. #ifndef M_LOG2E
  140. #define M_LOG2E     1.4426950408889634074
  141. #endif
  142. #ifndef M_LOG10E
  143. #define M_LOG10E    0.43429448190325182765
  144. #endif
  145. #ifndef M_LN2
  146. #define M_LN2       0.69314718055994530942
  147. #endif
  148. #ifndef M_LN10
  149. #define M_LN10      2.30258509299404568402
  150. #endif
  151. #ifndef M_PI
  152. #define M_PI        3.14159265358979323846
  153. #endif
  154. #ifndef M_PI_2
  155. #define M_PI_2      1.57079632679489661923
  156. #endif
  157. #ifndef M_1_PI
  158. #define M_1_PI      0.31830988618379067154
  159. #endif
  160. #ifndef M_PI_4
  161. #define M_PI_4      0.78539816339744830962
  162. #endif
  163. #ifndef M_2_PI
  164. #define M_2_PI      0.63661977236758134308
  165. #endif
  166. #ifndef M_2_SQRTPI
  167. #define M_2_SQRTPI  1.12837916709551257390
  168. #endif
  169. #ifndef M_SQRT2
  170. #define M_SQRT2     1.41421356237309504880
  171. #endif
  172. #ifndef M_SQRT1_2
  173. #define M_SQRT1_2   0.70710678118654752440
  174. #endif
  175.  
  176. #ifndef PI                      // as in stroustrup
  177. #define PI  M_PI
  178. #endif
  179. #ifndef PI2
  180. #define PI2  M_PI_2
  181. #endif
  182.  
  183. #ifdef __HAVE_68881__        /* MC68881/2 Floating-Point Coprocessor */
  184. #include <math-68881.h>
  185. /* Please add inline asm code for other machines here! */
  186. #endif
  187.  
  188. #endif
  189.