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)


109
110
111
112
113
114
115
# File 'lib/radiation/spectrum.rb', line 109

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