aboutsummaryrefslogtreecommitdiffstats
path: root/math.c
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 /math.c
parent68e111176ffb1d3f88e5605a5e3eeb8c200cce13 (diff)
downloadruby-0fdbdfbbda2e3d223d299b9df819402c3de82ecf.tar.gz
* 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.c5
1 files changed, 4 insertions, 1 deletions
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 {