Actions
Bug #3785
closedunexpected Numeric#step behaviour
Description
=begin
ruby-1.9.2-head > -0.5.step(0.5, 0.1) { |x| puts x }
-0.5
-0.4
-0.3
-0.19999999999999996
-0.09999999999999998
0.0
0.10000000000000009
0.20000000000000007
0.30000000000000004
0.4
0.5
=> -0.5
The same with 1.9.2-p0, but with 1.9.1-p429 and 1.8.7-p302:¶
ruby-1.8.7-p302 > -0.5.step(0.5, 0.1) { |x| puts x }
-0.5
-0.4
-0.3
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
=> -0.5
=end
Updated by darix (Marcus Rückert) over 14 years ago
=begin
maybe the links posted in this ticket http://redmine.ruby-lang.org/issues/show/3746 help?
=end
Updated by naruse (Yui NARUSE) over 14 years ago
- Status changed from Open to Rejected
=begin
Learn floating point numbers.
=end
Actions
Like0
Like0Like0