class Numeric

Public Instance Methods

negative?() click to toggle source
# File lib/backports/2.3.0/numeric/negative.rb, line 3
def negative?
  self < 0
end
positive?() click to toggle source
# File lib/backports/2.3.0/numeric/positive.rb, line 3
def positive?
  self > 0
end
round_with_digits(ndigits=0) click to toggle source
# File lib/backports/1.9.1/numeric/round.rb, line 6
def round_with_digits(ndigits=0)
  ndigits = Backports::coerce_to_int(ndigits)
  ndigits.zero? ? round_without_digits : Float(self).round(ndigits)
end