Module: Wrong::CloseTo
- Defined in:
- lib/wrong/close_to.rb
Instance Method Summary collapse
Instance Method Details
#close_to?(other, tolerance = 0.001) ⇒ Boolean
3 4 5 |
# File 'lib/wrong/close_to.rb', line 3 def close_to?(other, tolerance = 0.001) (self.to_f - other.to_f).abs < tolerance end |