summaryrefslogtreecommitdiffhomepage
path: root/mrblib/numeric.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-11-04 12:33:07 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-11-04 12:33:07 +0900
commitd6cb4f9cf2027eb20f67238aa6c051448602e7e6 (patch)
treec025d53534298097aadc3d7699de964bd8a7225f /mrblib/numeric.rb
parent388d26d77027feaa3e107abf7209e2681868bbe6 (diff)
parenta751f7f196e35cf85ac6f5c0d855edeb68b2bf53 (diff)
downloadmruby-d6cb4f9cf2027eb20f67238aa6c051448602e7e6.tar.gz
mruby-d6cb4f9cf2027eb20f67238aa6c051448602e7e6.zip
Merge branch 'pandax381-mrb_without_float'
Diffstat (limited to 'mrblib/numeric.rb')
-rw-r--r--mrblib/numeric.rb12
1 files changed, 1 insertions, 11 deletions
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