Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/radiation/spectrum.rb

Instance Method Summary collapse

Instance Method Details

#approx_equal?(other, threshold = 0.5) ⇒ Boolean

Returns:

  • (Boolean)


106
107
108
109
110
111
112
# File 'lib/radiation/spectrum.rb', line 106

def approx_equal?(other,threshold=0.5)
	if (self-other).abs < threshold    # "<" not exact either
		return true
	else
		return false
	end
end