Project

General

Profile

This project is closed and read-only.

Actions

Backport #7176

closed

Rational can't be coerced into BigDecimal (TypeError)

Backport #7176: Rational can't be coerced into BigDecimal (TypeError)

Added by aptinio (Aaron Tinio) almost 14 years ago. Updated almost 14 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)Actions
Actions

Also available in: PDF Atom