Class: Float
- Inherits:
-
Object
- Object
- Float
- Defined in:
- lib/float/equalindelta.rb
Overview
! /usr/bin/env ruby coding: utf-8
Instance Method Summary collapse
-
#equal_in_delta?(other, delta) ⇒ Boolean
return true if absolute value of the difference between self and other is smaller than delta.
Instance Method Details
#equal_in_delta?(other, delta) ⇒ Boolean
return true if absolute value of the difference between self and other is smaller than delta.
7 8 9 |
# File 'lib/float/equalindelta.rb', line 7 def equal_in_delta?(other, delta) (self - other).abs < delta end |