Project

General

Profile

Actions

Backport #2349

closed

lib/bigdecimal: errors in comparisons [patch]

Added by marcandre (Marc-Andre Lafortune) over 14 years ago. Updated almost 13 years ago.


Description

=begin
$ ruby -r bigdecimal -e 'p BigDecimal.new("1") < nil'
nil

expected: an error like with any other mathematical type:
-e:1:in `<': comparison of BigDecimal with nil failed (ArgumentError)


$ ruby -r bigdecimal -e 'p BigDecimal.new("1") == nil'
nil

expected: false like with any other Ruby object


$ ruby -r bigdecimal -e 'p BigDecimal.new("NaN") < 1'
nil

expected: false, like with any other mathematical comparison

I'll commit the attached patch in a few days (for 1.8 & 1.9) unless there are arguments against it.
=end


Files

bigdec.diff (2.37 KB) bigdec.diff marcandre (Marc-Andre Lafortune), 11/09/2009 03:33 PM
Actions #1

Updated by marcandre (Marc-Andre Lafortune) over 14 years ago

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

=begin
This issue was solved with changeset r25765.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) almost 14 years ago

  • Status changed from Closed to Assigned
  • Assignee changed from marcandre (Marc-Andre Lafortune) to shyouhei (Shyouhei Urabe)

=begin

=end

Actions #3

Updated by shyouhei (Shyouhei Urabe) almost 14 years ago

  • Assignee changed from shyouhei (Shyouhei Urabe) to wyhaines (Kirk Haines)

=begin
Well, a litte inspection shows me that

  • 1.9.2dev, 1.8.8dev, and 1.8.7 behave in the same way (as marcandre expected)
  • 1.9.1, and 1.8.6 behave as described in the original post

So I suspect 1.9.1 and 1.8.6 are buggy here, both should backport this.
=end

Actions #4

Updated by wyhaines (Kirk Haines) over 13 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r29025.
Marc-Andre, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0