approximately_equals.rb

Path: lib/eymiha/math/approximately_equals.rb
Last Update: Sat Mar 22 09:45:12 -0400 2008

Approminately equals returns true when values are close enough, within some distance epsilon above or below the given value. Three methods and a class variable are added to the Numeric class.

@@epsilon, and two class methods, Numeric.epsilon and Numeric.epsilon= get and set the maximum difference between two values for them to be approximately equal.

approximately_equals? and the aliased operator =~ return true if two values are approximately equal.

[Validate]