Open main menu

Sets floating point compare accuracy by specifying the tolerance value to be used when floating point values are compared.

Two floating point values will be considered equal if "abs(Value1 – Value2) <= ε", where ε is the tolerance value.

By default, the tolerance value is 2.2204460492503131e-012.

Usage

SetFPCompareAccuracy(Accuracy)

Parameters

Accuracy - an FPC constant or a numerical expression specifying a tolerance value as follows:

fpcVeryLowAccuracy  0  2.2204460492503131e-8
fpcLowAccuracy  1  2.2204460492503131e-10
fpcMedAccuracy  2  2.2204460492503131e-12 (Default)
fpcHighAccuracy  3  2.2204460492503131e-14
fpcVeryHighAccuracy  4  2.2204460492503131e-16
fpcExact  5  0.00

Example

Set floating point compare accuracy to High:

SetFPCompareAccuracy(3);

Set floating point compare accuracy to High:

SetFPCompareAccuracy(fpcHighAccuracy);