Functions.SetFloatDelta Method (Real8)
Return and optionally change the setting that determines the point at which 2 floating point numbers would be considered equal even though they are different.
XSharp.RT (in XSharp.RT.dll) Version: 2.18
Syntax Request Example
nNewSetting AS REAL8
) AS REAL8
public static double SetFloatDelta(
- Type: Real8
The acceptable difference between 2 numbers.
is not specified, SetFloatDelta() returns the current setting.
is specified, the previous setting is returned.
SetFloatDelta() determines the maximum amount by which 2 floating point numbers could be different and yet still be considered equal. Two numbers might be considerably different, but the difference will be ignored if the setting for SetFloatDelta() is larger than the difference between the 2 numbers.
This example uses SetFloatDelta() to change the result of numeric comparisons:
1? 1.231 = 1.23
2? 1.33 = 1.23
4? 1.231 = 1.23
5? 1.33 = 1.23
6? 1.4 < 1.40123456
7? 1.4 < 1.42