diff options
| author | YAMAMOTO Masaya <[email protected]> | 2017-10-11 17:53:17 +0900 |
|---|---|---|
| committer | YAMAMOTO Masaya <[email protected]> | 2017-10-11 17:58:11 +0900 |
| commit | acdc2d1f242f2547ca842be5d62a2b06356b39ea (patch) | |
| tree | 3479c21be76ce7edde6a5fcacb6f60c1a5698a8a /mrblib/numeric.rb | |
| parent | 679dfd75a8aeb26ee4ff0d7c148e1f6e88e39c3d (diff) | |
| download | mruby-acdc2d1f242f2547ca842be5d62a2b06356b39ea.tar.gz mruby-acdc2d1f242f2547ca842be5d62a2b06356b39ea.zip | |
Add MRB_WITHOUT_FLOAT
Diffstat (limited to 'mrblib/numeric.rb')
| -rw-r--r-- | mrblib/numeric.rb | 12 |
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 |
