In Files

  • mrblib/numeric.rb

Parent

Methods

Included Modules

Numeric

Numeric

ISO 15.2.7

Public Instance Methods

+@() click to toggle source

Returns the receiver simply.

ISO 15.2.7.4.1

 
               # File mrblib/numeric.rb, line 11
def +@
  self
end
            
-@() click to toggle source

Returns the receiver’s value, negated.

ISO 15.2.7.4.2

 
               # File mrblib/numeric.rb, line 19
def -@
  0 - self
end
            
abs() click to toggle source

Returns the absolute value of the receiver.

ISO 15.2.7.4.3

 
               # File mrblib/numeric.rb, line 27
def abs
  if self < 0
    -self
  else
    self
  end
end