From: "NARUSE, Yui" Date: 2011-09-16T10:16:23+09:00 Subject: [ruby-core:39569] Re: [Ruby 1.9 - Bug #4576] Range#step miss the last value, if end-exclusive and has float number 2011/9/16 Kenta Murata : > On Friday, September 16, 2011 at 02:14 , Marc-Andre Lafortune wrote: >> The patch has been committed as r33282 > > 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. > >> 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 > > I think it is not a bug, but is a specification problem. > The issue is related to what is to_s. I reverted r33282 because * Ruby keeps it as platform dependent or simply use -ffloat-store (/fp:precise) * amd64 won't get this issue because compilers for amd64 uses SSE2 to calculate floating point numbers instead of x87 FPU. * this change won't fix the issue under -O * this commit has no test for the changed behavior -- NARUSE, Yui �