From acdc2d1f242f2547ca842be5d62a2b06356b39ea Mon Sep 17 00:00:00 2001 From: YAMAMOTO Masaya Date: Wed, 11 Oct 2017 17:53:17 +0900 Subject: Add MRB_WITHOUT_FLOAT --- mrblib/numeric.rb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'mrblib/numeric.rb') diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb index 89401a084..1b11e92ad 100644 --- a/mrblib/numeric.rb +++ b/mrblib/numeric.rb @@ -104,7 +104,7 @@ module Integral raise ArgumentError, "step can't be 0" if step == 0 return to_enum(:step, num, step) unless block - i = if num.kind_of? Float then self.to_f else self end + i = if class_defined?("Float") && num.kind_of?(Float) then self.to_f else self end if num == nil while true block.call(i) @@ -161,13 +161,3 @@ class Integer # ISO 15.2.8.3.26 alias truncate floor end - -## -# Float -# -# ISO 15.2.9 -class Float - # mruby special - since mruby integers may be upgraded to floats, - # floats should be compatible to integers. - include Integral -end -- cgit v1.2.3