SetFPCompareAccuracy
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 | 02.2204460492503131e-8 |
fpcLowAccuracy |
1 | 12.2204460492503131e-10 |
fpcMedAccuracy |
2 | 22.2204460492503131e-12 (Default) |
fpcHighAccuracy |
3 | 32.2204460492503131e-14 |
fpcVeryHighAccuracy |
4 | 42.2204460492503131e-16 |
fpcExact |
5 | 50.00 |
Example
Set floating point compare accuracy to High:
SetFPCompareAccuracy(3);
Set floating point compare accuracy to High:
SetFPCompareAccuracy(fpcHighAccuracy);