summaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-12 18:41:31 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-12 18:41:31 +0000
commit8fd52acd7d22841cda421692f722c1e9bc789979 (patch)
tree468138a64cf6cc662e3242919f748ddbc0c4a235 /numeric.c
parent238eb6170cd3a626ddcdf1e05f16bef809601bde (diff)
downloadruby-8fd52acd7d22841cda421692f722c1e9bc789979.tar.gz
ruby-8fd52acd7d22841cda421692f722c1e9bc789979.tar.xz
ruby-8fd52acd7d22841cda421692f722c1e9bc789979.zip
* numeric.c (flo_divmod): round to the nearest integer. [ ruby-Bugs-14540 ]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index dbe273bbc..d9466daa9 100644
--- a/numeric.c
+++ b/numeric.c
@@ -715,7 +715,7 @@ flo_divmod(VALUE x, VALUE y)
}
flodivmod(RFLOAT(x)->value, fy, &div, &mod);
if (FIXABLE(div)) {
- val = div;
+ val = round(div);
a = LONG2FIX(val);
}
else {