method

round

v1_8_7_330 - Show latest stable - Class: Float
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