diff options
Diffstat (limited to 'missing/acosh.c')
| -rw-r--r-- | missing/acosh.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/missing/acosh.c b/missing/acosh.c index 59f4af9248..c6695b599e 100644 --- a/missing/acosh.c +++ b/missing/acosh.c @@ -3,7 +3,6 @@ acosh.c - $Author$ - $Date$ created at: Fri Apr 12 00:34:17 JST 2002 public domain rewrite of acosh(3), asinh(3) and atanh(3) @@ -13,6 +12,7 @@ #include <errno.h> #include <float.h> #include <math.h> +#include "ruby.h" /* DBL_MANT_DIG must be less than 4 times of bits of int */ #ifndef DBL_MANT_DIG @@ -80,6 +80,14 @@ atanh(double x) if (z < SMALL_CRITERIA) return x; z = log(z > 1 ? -1 : (1 + z) / (1 - z)) / 2; if (neg) z = -z; + if (isinf(z)) +#if defined(ERANGE) + errno = ERANGE; +#elif defined(EDOM) + errno = EDOM; +#else + ; +#endif return z; } #endif |
