From: Marc-Andre Lafortune Date: 2011-09-16T15:31:25+09:00 Subject: [ruby-core:39576] Re: [Ruby 1.9 - Bug #4576] Range#step miss the last value, if end-exclusive and has float number Hi, On Thu, Sep 15, 2011 at 8:57 PM, Kenta Murata wrote: > I cannot find tests for the commit r33282. Please tell me where the tests are. > If you write the tests in RubySpec, please describe the commit hashes of the corresponding > commits of RubySpec in the commit message of the commit of CRuby. Good idea, I'll include the commit hash in future commits, with the format [rubyspec:a9525edcd], unless there is another suggestion. Note that the RubySpec is easy to find, either with `git log --grep=4576` or `grep -r 4576 .`, or looking up the path of the modified method(s) (here core/range/step_spec.rb). The hash in the commit will be an additional way. >> Would it be ok if `Float("3.0e-31").to_s == "3.0000000000000003e-31"`? > > I've objected to the behavior. Please look at the rejected my report. > http://redmine.ruby-lang.org/issues/4656 Actually, in my example, 3.0e-31 != 3.0000000000000003e-31. As for why up to 17 decimals may be needed to represent a float, see my original issue #3273, or http://en.wikipedia.org/wiki/IEEE_754-2008#Character_representation