Project

General

Profile

Backport #1648 » RUBY-1648.patch

calavera (David Calavera), 08/27/2009 10:50 PM

View differences:

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
(1-1/2)