AlmostEqual
|
Math functions |
SYNTAX | AlmostEqual( x, y, ulps = 5 ) |
RETURNS | NUMBER ARRAY |
FUNCTION | This is a helper function for comparing floating point numbers. It returns True if x and y are equal or almost equal upto defined accurracy (ulps). It is recommended to use this function instead of equality check (==) as it leads to more reliable comparisons and less headache caused by IEEE floating pointacurracy issues.
Parameters:
|
EXAMPLE | if( 1/3 == 0.3333333 ) |
SEE ALSO |
The AlmostEqual function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.