diff --git a/ChangeLog b/ChangeLog index 165bc1246d..b58f21f7b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Wed Sep 21 11:17:22 2011 NARUSE, Yui + + * numeric.c (ruby_float_step): improve floating point calculations. + [ruby-core:35753] [Bug #4576] + + * numeric.c (ruby_float_step): correct the error of floating point + numbers on the excluding case. + patched by Masahiro Tanaka [ruby-core:39608] + + * numeric.c (ruby_float_step): use the end value when the current + value is greater than or equal to the end value. + patched by Akira Tanaka [ruby-core:39612] + Wed Oct 5 05:56:39 2011 Eric Hodel * hash.c (Init_Hash): Improve Hash documentation. Patch by Alvaro diff --git a/numeric.c b/numeric.c index 6d3c1432e8..166dc520de 100644 --- a/numeric.c +++ b/numeric.c @@ -1690,10 +1690,25 @@ ruby_float_step(VALUE from, VALUE to, VALUE step, int excl) } else { if (err>0.5) err=0.5; - n = floor(n + err); - if (!excl || ((long)n)*unit+beg < end) n++; - for (i=0; i0) { + if (n