summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--numeric.c8
2 files changed, 6 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 93fcceb24b..6fa69b680f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jul 4 08:20:03 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * numeric.c (dbl2ival): should raise FloatDomainError on Infinity
+ and NaN as 1.8 does. [ruby-dev:38726]
+
Fri Jul 3 22:48:45 2009 Tanaka Akira <akr@fsij.org>
* time.c (find_time_t): less number of guesses for hh:mm:60.
diff --git a/numeric.c b/numeric.c
index 4c9bcd9660..5846610c71 100644
--- a/numeric.c
+++ b/numeric.c
@@ -756,13 +756,7 @@ dbl2ival(double d)
d = round(d);
return LONG2FIX((long)d);
}
- else if (isnan(d) || isinf(d)) {
- /* special case: cannot return integer value */
- return rb_float_new(d);
- }
- else {
- return rb_dbl2big(d);
- }
+ return rb_dbl2big(d);
}
/*