Project

General

Profile

Actions

Bug #3945

closed

Numeric#step with infinity unit

Bug #3945: Numeric#step with infinity unit

Added by naruse (Yui NARUSE) about 15 years ago. Updated over 14 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.3dev (2010-10-13 trunk 29489) [x86_64-freebsd8.1]
Backport:
[ruby-core:32779]

Description

=begin
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
=end


Related issues 1 (0 open1 closed)

Related to Ruby - Bug #781: Numeric#step で step として Infinity をつかうと NaN を生成することがあるClosedActions
Actions

Also available in: PDF Atom