Project

General

Profile

Backport #1648 » RUBY-1648_v2.patch

calavera (David Calavera), 08/28/2009 03:21 PM

View differences:

lib/rational.rb (copia de trabajo)
self / Rational.new!(a, 1)
elsif a.kind_of?(Float)
Float(self) / a
elsif !a.respond_to?(:coerce)
raise TypeError, "#{a.class.name} can't be coerced to #{self.class.name}"
else
x, y = a.coerce(self)
x / y
(2-2/2)