Class: MathTrick

Inherits:
Object
  • Object
show all
Defined in:
lib/nearfive.rb

Instance Method Summary collapse

Instance Method Details

#round_to_near_point_five(x, precision) ⇒ Object



2
3
4
# File 'lib/nearfive.rb', line 2

def round_to_near_point_five(x,precision)
  (x*(2.0*(10**precision))).round / (2.0*(10**precision))
end