summaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-07 13:23:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-07 13:23:24 +0000
commitdf1e8a6cd09df6acb4c62920ff003aff26ed2078 (patch)
treefff6acd7d36fa8a1d3d037ec5e70e9d38d6fee9f /numeric.c
parent4f615c55c030a0ffd3bc8f0c0c6837d7d2422437 (diff)
downloadruby-df1e8a6cd09df6acb4c62920ff003aff26ed2078.tar.gz
ruby-df1e8a6cd09df6acb4c62920ff003aff26ed2078.tar.xz
ruby-df1e8a6cd09df6acb4c62920ff003aff26ed2078.zip
* numeric.c (fix_divide): float division should floor() before
rounding into integer. [ruby-dev:34584] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16314 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 ed8b3ff6b..775f392e5 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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: