FloatingPointComparison.EqualsSignificantDigitsOrAbsoluteError Method |
Compares two numbers up to the specified number of significant digits or by their absolute error.
Namespace:
AGI.Foundation
Assembly:
AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 25.1.421.0 (25.1.421.0)
Syntaxpublic static bool EqualsSignificantDigitsOrAbsoluteError(
double x,
double y,
int significantDigits,
double absoluteError
)
Public Shared Function EqualsSignificantDigitsOrAbsoluteError (
x As Double,
y As Double,
significantDigits As Integer,
absoluteError As Double
) As Boolean
public:
static bool EqualsSignificantDigitsOrAbsoluteError(
double x,
double y,
int significantDigits,
double absoluteError
)
static member EqualsSignificantDigitsOrAbsoluteError :
x : float *
y : float *
significantDigits : int *
absoluteError : float -> bool
Parameters
- x
- Type: System.Double
The first number to compare. - y
- Type: System.Double
The second number to compare - significantDigits
- Type: System.Int32
The number of significant digits to consider in the comparison. - absoluteError
- Type: System.Double
The maximum allowable difference between x and y.
Return Value
Type:
Booleantrue if the nth significant digit of the two numbers differ by no more than 1
and all preceding significant digits are equal, or if the difference between the two numbers is
less than the absolute error specified; otherwise
false.
See Also