[ruby-core:32779] [Ruby 1.9-Bug#3945][Open] Numeric#step with infinity unit

From: Yui NARUSE <redmine@...>
Date: 2010-10-13 19:16:01 UTC
List: ruby-core #32779
Bug #3945: Numeric#step with infinity unit
http://redmine.ruby-lang.org/issues/show/3945

Author: Yui NARUSE
Status: Open, Priority: Normal
Target version: 1.9.3
ruby -v: ruby 1.9.3dev (2010-10-13 trunk 29489) [x86_64-freebsd8.1]

Numeric#step with infinity unit doesn't works well:

> 1.step(0, Float::INFINITY) {|x| p x }
1.0
=> 1
1.step(0, -Float::INFINITY) {|x| p x }
=> 1

Expected result is:

> 1.step(0, Float::INFINITY) {|x| p x }
=> 1
1.step(0, -Float::INFINITY) {|x| p x }
1.0
=> 1


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next