summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--numeric.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 062c81048b..badd4d21ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/numeric.c b/numeric.c
index ed8b3ff6b7..775f392e52 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: