Should not refer `Float` class in case of `MRB_WITHOUT_FLOAT`.

This commit removes `Float` from `rational.c`.
parent 5d30309e
......@@ -48,12 +48,9 @@ class Rational < Numeric
end
def <=>(rhs)
case rhs
when Fixnum
if rhs.is_a?(Integral)
return numerator <=> rhs if denominator == 1
rhs = Rational(rhs)
when Float
return to_f <=> rhs
end
case rhs
......@@ -103,5 +100,5 @@ end
end
__send__(original_operator_name, rhs)
end
end
end if Object.const_defined?(:Float)
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment