path: root/math.c
diff options
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-25 02:51:16 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-25 02:51:16 (GMT)
commit0fdbdfbbda2e3d223d299b9df819402c3de82ecf (patch)
treeda28c3cf9a64fa6c8f5306ae19f6f77dc65bcb71 /math.c
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:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
1 files changed, 4 insertions, 1 deletions
diff --git a/math.c b/math.c
index bc6b7eb..1d7d5e4 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 {