From 363b0bddde815a459f04e1d167d56bd1f498275c Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 19 Jun 2008 07:51:46 +0000 Subject: * 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 --- missing/acosh.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'missing') 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 #include #include +#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 -- cgit v1.2.3