Project

General

Profile

Actions

Bug #3648

closed

Bignum Incomparable with Float::INFINITY

Added by runpaint (Run Paint Run Run) over 13 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-07-12 trunk 28620) [i686-linux]
Backport:
[ruby-core:31603]

Description

=begin

27 > Float::INFINITY
=> false
2
79 > Float::INFINITY
=> -1
279 < Float::INFINITY
=> -1
big = 2
77889
big.is_a? Bignum
=> true
big == Float::INFINITY
=> true
=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r28844.
Run Paint, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #2

Updated by mame (Yusuke Endoh) over 13 years ago

  • Status changed from Closed to Open
  • Target version set to 2.0.0

=begin
Hi,

r28844 caused the following rubyspec errors.

Bignum#quo does not raise a FloatDomainError when the given argument is 0 and a Float FAILED
Expected "9223372036854775811/0"
to equal "Infinity"

/home/mame/work/ruby/spec/rubyspec/core/bignum/quo_spec.rb:31:in block (2 levels) in <top (required)>' /home/mame/work/ruby/spec/rubyspec/core/bignum/quo_spec.rb:3:in <top (required)>'

Complex#/ with Float returns Complex(Infinity, Infinity) when given zero ERROR
NoMethodError: undefined method infinite?' for (20/0):Rational /home/mame/work/ruby/spec/rubyspec/shared/complex/divide.rb:41:in block (2 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/complex/divide_spec.rb:17:in block in <top (required)>' /home/mame/work/ruby/spec/rubyspec/core/complex/divide_spec.rb:1:in <top (required)>'

Fixnum#quo does not raise a FloatDomainError when the given Integer is 0 and a Float FAILED
Expected "0/0"
to equal "NaN"

/home/mame/work/ruby/spec/rubyspec/core/fixnum/quo_spec.rb:29:in block (2 levels) in <top (required)>' /home/mame/work/ruby/spec/rubyspec/core/fixnum/quo_spec.rb:3:in <top (required)>'

Rational#/ when passed a Float returns infinity when passed 0 ERROR
NoMethodError: undefined method infinite?' for (3/0):Rational /home/mame/work/ruby/spec/rubyspec/shared/rational/divide.rb:42:in block (2 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/rational/divide_spec.rb:16:in block in <top (required)>' /home/mame/work/ruby/spec/rubyspec/core/rational/divide_spec.rb:1:in <top (required)>'

--
Yusuke Endoh
=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

  • Status changed from Open to Closed

=begin
fixed at r28886 and r28887.
=end

Updated by naruse (Yui NARUSE) over 10 years ago

  • Description updated (diff)
  • Status changed from Closed to Assigned
  • Target version changed from 2.0.0 to 2.1.0

r42954 reverted the commit

Updated by hsbt (Hiroshi SHIBATA) about 10 years ago

  • Target version changed from 2.1.0 to 2.2.0

Updated by hsbt (Hiroshi SHIBATA) over 7 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0