Click or drag to resize

FloatingPointComparisonEqualsSignificantDigitsOrAbsoluteError 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: 21.1.408.0 (21.1.408.0)
public static bool EqualsSignificantDigitsOrAbsoluteError(
	double x,
	double y,
	int significantDigits,
	double absoluteError


Type: SystemDouble
The first number to compare.
Type: SystemDouble
The second number to compare
Type: SystemInt32
The number of significant digits to consider in the comparison.
Type: SystemDouble
The maximum allowable difference between x and y.

Return Value

Type: Boolean
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 .
See Also