Loading

~=


math operators
Since v1.0.0
Available on all platforms

The ~= operator consumes three parameters from the top of the stack, two operands p1 and p2 and a tolerance factor lambda, and pushes onto the stack true if |p1-p2| < lambda, i.e. the difference between the two operands is lesser than lambda.

The two parameters must be of numeric types.

The operator ~= is useful when making comparaisons between doubles, where floating point operations generate rounding errors.

Signature

Examples

PI 3.1415926 1e-8 ~= //false PI 3.1415926 1e-6 ~= //true