summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-25 02:51:16 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-25 02:51:16 +0000
commit0fdbdfbbda2e3d223d299b9df819402c3de82ecf (patch)
treeda28c3cf9a64fa6c8f5306ae19f6f77dc65bcb71
parent68e111176ffb1d3f88e5605a5e3eeb8c200cce13 (diff)
* math.c (domain_check): ignore errno if y is inf.
r26335 is because NetBSD 5.0's asin and acos returns 0.0 with errno EDOM. But it breaks Linux whose gamma returns inf with errno ERANGE on. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--math.c5
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5953d17e4f..197aa98a17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Jan 25 11:45:47 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * math.c (domain_check): ignore errno if y is inf.
+ r26335 is because NetBSD 5.0's asin and acos returns
+ 0.0 with errno EDOM. But it breaks Linux whose gamma returns inf
+ with errno ERANGE on.
+
Sun Jan 24 22:48:05 2010 Koichi Sasada <ko1@atdot.net>
* eval.c, vm.c, vm_eval.c, vm_insnhelper.c: fix issues about
@@ -228,6 +235,7 @@ Sun Jan 17 22:48:44 2010 Akinori MUSHA <knu@iDaemons.org>
Sun Jan 17 19:24:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* math.c (domain_check): check errno first.
+ NetBSD 5.0's asin and acos returns 0.0 with errno EDOM.
Sun Jan 17 14:24:35 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
diff --git a/math.c b/math.c
index bc6b7eb333..1d7d5e4188 100644
--- a/math.c
+++ b/math.c
@@ -27,7 +27,10 @@ extern VALUE rb_to_float(VALUE val);
static void
domain_check(double x, double y, const char *msg)
{
- if (!errno) {
+ if (errno) {
+ if (isinf(y)) return;
+ }
+ else {
if (!isnan(y)) return;
else if (isnan(x)) return;
else {