This project is closed and read-only.
Backport #1648 » RUBY-1648.patch
| lib/rational.rb (copia de trabajo) | ||
|---|---|---|
|
self / Rational.new!(a, 1)
|
||
|
elsif a.kind_of?(Float)
|
||
|
Float(self) / a
|
||
|
elsif !a.kind_of?(Numerical)
|
||
|
raise TypeError, "#{a.class.name} can't be coerced to #{self.class.name}"
|
||
|
else
|
||
|
x, y = a.coerce(self)
|
||
|
x / y
|
||