diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-25 02:51:16 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-01-25 02:51:16 +0000 |
commit | 0fdbdfbbda2e3d223d299b9df819402c3de82ecf (patch) | |
tree | da28c3cf9a64fa6c8f5306ae19f6f77dc65bcb71 /math.c | |
parent | 68e111176ffb1d3f88e5605a5e3eeb8c200cce13 (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
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 { |