summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index d1f59054589..568d6c0ea14 100644
--- a/numeric.c
+++ b/numeric.c
@@ -443,7 +443,8 @@ flo_cmp(x, y)
}
if (a == b) return INT2FIX(0);
if (a > b) return INT2FIX(1);
- return INT2FIX(-1);
+ if (a < b) return INT2FIX(-1);
+ rb_raise(rb_eFloatDomainError, "comparing NaN");
}
static VALUE