Project

General

Profile

Actions

Backport #7176

closed

Rational can't be coerced into BigDecimal (TypeError)

Added by aptinio (Aaron Tinio) about 12 years ago. Updated about 12 years ago.

Status:
Closed
[ruby-core:48045]

Description

Rational + BigDecimal makes a BigDecimal as follows:

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

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 '


Related issues 1 (0 open1 closed)

Related to Backport193 - Backport #7404: BigDecimal#add(Float) のみ BigDecimal を返し、他の四則演算では例外になるClosedusa (Usaku NAKAMURA)11/19/2012Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0