From 4e5325fe1f8ca173cbd4875379cd6da61abb6a50 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Fri, 20 May 2011 22:29:05 +0000 Subject: merge revision(s) 31302: backported r31286 from trunk * numeric.c (ruby_float_step): wrong loop condition. fixes [ruby-core:35753], reported by Joey Zhou. * test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753): test above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@31302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e Signed-off-by: URABE, Shyouhei git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@31663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ numeric.c | 2 +- test/ruby/test_range.rb | 9 +++++++++ version.h | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index acefc5d224..dc4d4c06f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Sat May 21 01:32:08 2011 NAKAMURA Usaku + + backported r31286 from trunk + + * numeric.c (ruby_float_step): wrong loop condition. + fixes [ruby-core:35753], reported by Joey Zhou. + + * test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753): + test above change. + Sat May 21 00:55:21 2011 NARUSE, Yui * ext/zlib/zlib.c (gzfile_check_footer): ISIZE (Input SIZE) in gzip's diff --git a/numeric.c b/numeric.c index 634c2eb940..7d557db74f 100644 --- a/numeric.c +++ b/numeric.c @@ -1447,7 +1447,7 @@ ruby_float_step(from, to, step, excl) if (err>0.5) err=0.5; n = floor(n + err); - if (!excl) n++; + if (!excl || ((long)n)*unit+beg < end) n++; for (i=0; i