Class: Numeric
Instance Method Summary collapse
-
#close?(to, delta) ⇒ Boolean
Check whether this number is within
deltaofto.
Instance Method Details
#close?(to, delta) ⇒ Boolean
Check whether this number is within delta of to.
62 63 64 |
# File 'lib/scampi/monkey_patches.rb', line 62 def close?(to, delta) (to.to_f - self).abs <= delta.to_f rescue false end |