kotp
3/15/2013 - 9:42 PM

float_near_enough.rb

class Float
  def near_enough?(other, epsilon = Float::EPSILON)
    (self - other.to_f).abs < epsilon.to_f
  end  
end