Class: Float
Instance Method Summary collapse
-
#equals?(x, tolerance = 1e-6) ⇒ Boolean
Equals for floats with tolerance.
Instance Method Details
#equals?(x, tolerance = 1e-6) ⇒ Boolean
Equals for floats with tolerance
3 4 5 |
# File 'lib/darkext/float.rb', line 3 def equals?(x, tolerance = 1e-6) (self - x).abs < tolerance end |