Skip to content

Commit

Permalink
* math.c (domain_check): ignore errno if y is inf.
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
nurse committed Jan 25, 2010
1 parent 68e1111 commit 0fdbdfb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions 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
Expand Down Expand Up @@ -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>

Expand Down
5 changes: 4 additions & 1 deletion math.c
Expand Up @@ -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 {
Expand Down

0 comments on commit 0fdbdfb

Please sign in to comment.