Loading

~=

math operators

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.

All parameters must be of numeric types.

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

~= is available since version 1.0.0.

Signatures

Examples

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