+1 888 340 6572

SetFPCompareAccuracy

From MultiCharts
Revision as of 13:16, 24 February 2012 by Admin (talk | contribs) (→‎Parameters)

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);