aboutsummaryrefslogtreecommitdiffstats
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 5072a04196..3570298a26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Sep 6 06:44:57 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
+
+ * numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit
+ platform. part 1 of [bug #5276]
+
Tue Sep 6 06:44:25 2011 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* numeric.c (flo_round): Fix criteria for 32 bits platform
diff --git a/numeric.c b/numeric.c
index 87afe14662..18f5e1cd1a 100644
--- a/numeric.c
+++ b/numeric.c
@@ -873,8 +873,8 @@ flo_mod(VALUE x, VALUE y)
static VALUE
dbl2ival(double d)
{
+ d = round(d);
if (FIXABLE(d)) {
- d = round(d);
return LONG2FIX((long)d);
}
return rb_dbl2big(d);