This project is closed and read-only.
Actions
Backport #2349
closedlib/bigdecimal: errors in comparisons [patch]
Backport #2349:
lib/bigdecimal: errors in comparisons [patch]
Status:
Closed
Assignee:
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
Actions