diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-19 07:51:46 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-19 07:51:46 +0000 |
commit | 363b0bddde815a459f04e1d167d56bd1f498275c (patch) | |
tree | 8eea7565da73c5c937c59a775e10faf28e6f899b /missing | |
parent | 6bb934c482e360b1713ca692301c30a6277f4bd3 (diff) | |
download | ruby-363b0bddde815a459f04e1d167d56bd1f498275c.tar.gz |
* missing/acosh.c (atanh): should set ERANGE to errno if parameter
is the boundary case. fixed [ruby-dev:35155]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r-- | missing/acosh.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/missing/acosh.c b/missing/acosh.c index 41add2e4b6..c6695b599e 100644 --- a/missing/acosh.c +++ b/missing/acosh.c @@ -12,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 @@ -79,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 |