diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-04 00:46:14 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-04 00:46:14 +0000 |
commit | a82c5ee48b805333f68b613b8eb76cd05e5a0078 (patch) | |
tree | 3da0581d445db95427c6b4715d4ff6187d44bbc8 | |
parent | b083b7eea60f514c10a3162218058b380c0ae297 (diff) | |
download | ruby-a82c5ee48b805333f68b613b8eb76cd05e5a0078.tar.gz |
* 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-- | ChangeLog | 5 | ||||
-rw-r--r-- | numeric.c | 8 |
2 files changed, 6 insertions, 7 deletions
@@ -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. @@ -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); } /* |