From 618a1acfdc526737d6bf6bcde916cd7cfbad0e28 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: http://svn.ruby-lang.org/repos/ruby/trunk@17425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/acosh.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'missing/acosh.c') diff --git a/missing/acosh.c b/missing/acosh.c index 41add2e4b..c6695b599 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