Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/neuroevo/monkey.rb

Instance Method Summary collapse

Instance Method Details

#approximates?(other, epsilon = 1e-5) ⇒ Boolean

Returns:

  • (Boolean)

169
170
171
172
# File 'lib/neuroevo/monkey.rb', line 169

def approximates? other, epsilon=1e-5
  # Used for testing and NMatrix#approximates?, should I move to spec_helper?
  (self - other).abs < epsilon
end