summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-04 00:46:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-04 00:46:14 +0000
commita82c5ee48b805333f68b613b8eb76cd05e5a0078 (patch)
tree3da0581d445db95427c6b4715d4ff6187d44bbc8
parentb083b7eea60f514c10a3162218058b380c0ae297 (diff)
* numeric.c (dbl2ival): should raise FloatDomainError on Infinity
and NaN as 1.8 does. [ruby-dev:38726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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);
}
/*