round() public

Rounds flt to the nearest integer. Equivalent to:

def round
  return (self+0.5).floor if self > 0.0
  return (self-0.5).ceil  if self < 0.0
  return 0
end

1.5.round      #=> 2
(-1.5).round   #=> -2
Show source
Register or log in to add new notes.