In Files

  • mrblib/numeric.rb

Parent

Methods

Included Modules

Float

Float

ISO 15.2.9

Public Instance Methods

<<(other) click to toggle source
 
               # File mrblib/numeric.rb, line 173
def << other
  n = self.to_i
  other.to_i.times {
    n *= 2
  }
  n.to_i
end
            
>>(other) click to toggle source

mruby special - since mruby integers may be upgraded to floats, floats should be compatible to integers.

 
               # File mrblib/numeric.rb, line 166
def >> other
  n = self.to_i
  other.to_i.times {
    n /= 2
  }
  n
end