Module: Math
- Defined in:
- lib/osb/math.rb
Class Method Summary collapse
-
.fuzzy_equal(x, y, tolerance = 1e-8) ⇒ Boolean
Returns whether 2 real numbers are equal within tolerance.
Class Method Details
.fuzzy_equal(x, y, tolerance = 1e-8) ⇒ Boolean
Returns whether 2 real numbers are equal within tolerance.
9 10 11 |
# File 'lib/osb/math.rb', line 9 def self.fuzzy_equal(x, y, tolerance = 1e-8) (x - y).abs < tolerance end |