mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Should not refer Float class in case of MRB_WITHOUT_FLOAT.
This commit removes `Float` from `rational.c`.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user