summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
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 {