@FloatEq (Formula Language)
Compares two numbers for equality within a confidence range.
Note: This @function is new with Release 6.
Syntax
@FloatEq( number ; number ; confidenceRange )
Parameters
number
Number or number list. Any numeric value.
confidenceRange
Number. Optional. The amount within which the numbers must be equal. Defaults to 0.0001.
Return value
flag
Boolean.
- Returns 1 (True) if the difference of the numbers is less than the confidence range.
- Returns 0 (False) if the difference of the numbers exceeds or
is equal to the confidence range.
Examples
This action formula compares the fields SpecifiedLength and MeasuredLength, and displays a message if the fields are not within 0.01. If MeasuredLength is a list, the message appears only if every element is not within 0.01.@If(@FloatEq(SpecifiedLength; MeasuredLength; 0.01); "";
@Prompt([OK]; "Length is out of spec";
@Text(MeasuredLength)))
Usage
If either parameter is a list, the function compares the first two parameters pair-wise and returns 1 if any comparison is within range.
@FloatEq is helpful in dealing with the inexactness of floating point operations.