summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 07:51:46 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 07:51:46 +0000
commit618a1acfdc526737d6bf6bcde916cd7cfbad0e28 (patch)
tree8eea7565da73c5c937c59a775e10faf28e6f899b
parent2b53e89b8c96d26d1c1dd31b773dcd6221ad40d7 (diff)
downloadruby-618a1acfdc526737d6bf6bcde916cd7cfbad0e28.tar.gz
ruby-618a1acfdc526737d6bf6bcde916cd7cfbad0e28.tar.xz
ruby-618a1acfdc526737d6bf6bcde916cd7cfbad0e28.zip
* 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
-rw-r--r--ChangeLog5
-rw-r--r--missing/acosh.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e76467092..ea83cb89c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jun 19 16:49:36 2008 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * missing/acosh.c (atanh): should set ERANGE to errno if parameter
+ is the boundary case. fixed [ruby-dev:35155]
+
Thu Jun 19 16:06:01 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/lib/tkextlib/tile/treeview.rb: cannot configure tags.
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 <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