diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-07 13:23:24 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-07 13:23:24 +0000 |
commit | 274c6471b870cb36475c9e6ca3ef6e82a8250187 (patch) | |
tree | fff6acd7d36fa8a1d3d037ec5e70e9d38d6fee9f | |
parent | ffd4bf96cc26a767e3ab10548cd5ddd5c1782712 (diff) |
* numeric.c (fix_divide): float division should floor() before
rounding into integer. [ruby-dev:34584]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | numeric.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -4,6 +4,11 @@ Wed May 7 20:19:18 2008 NAKAMURA Usaku <usa@ruby-lang.org> after Init_prelude() because cannot load encoding extensions before it. +Wed May 7 19:30:34 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * numeric.c (fix_divide): float division should floor() before + rounding into integer. [ruby-dev:34584] + Wed May 7 18:02:01 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * string.c (sym_to_i): remove obsolete method. preparation for @@ -2260,7 +2260,7 @@ fix_divide(VALUE x, VALUE y, ID op) return DOUBLE2NUM(div); } else { - return rb_dbl2big(div); + return rb_dbl2big(floor(div)); } } default: |