Project

General

Profile

Actions

Bug #2129

closed

Rational can't be coerced into BigDecimal (TypeError)

Added by kubo (Takehiro Kubo) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.2dev (2009-09-20 trunk 25012) [x86_64-linux]
Backport:
[ruby-core:25697]

Description

=begin
Rational + BigDecimal makes a Rational as follows:

$ ruby -rbigdecimal -e "puts Rational(1) + BigDecimal.new('1')"
2/1

But BigDecimal + Rationl raises a TypeError as follows:

$ ruby -rbigdecimal -e "puts BigDecimal.new('1') + Rational(1)"
-e:1:in +': Rational can't be coerced into BigDecimal (TypeError) from -e:1:in '
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0