Return e_EQUAL if the specified a and b have fuzzy equality, e_GREATER_THAN if a > b, e_LESS_THAN if a < b, and e_NON_COMPARABLE if either a or b are a NaN. Optionally specify the relative tolerance relTol, or relTol and the absolute tolerance absTol, used to determine fuzzy equality. If an optional tolerance argument is not specified, a reasonable (implementation-dependent) default value for that tolerance is used. Fuzzy equality (denoted "a ~eq b") between a and b is defined in terms of the relative tolerance relTol and the absolute tolerance absTol such that the expression: ` a == b || fabs(a - b) <= absTol || fabs(a - b) / fabs((a + b) / 2.0) <= relTol ` is true; however, in the special case where a != 0 && a == -b is true, the actual relative difference is effectively infinite, and no value of relTol can imply fuzzy equality (although a sufficiently large value of absTol can). Note that if either absTol or relTol is 0.0, that aspect of fuzzy comparison is effectively suppressed, but the behavior of this function is defined. The behavior is undefined unless both 'relTol and absTol` are non-negative, finite numbers (which excludes NaN and infinity). Note also that the primary purpose of this public static comparison method is to implement the six fuzzy equality and relational functions also defined within this utility struct (see fuzzyEq, fuzzyNe, fuzzyLt, fuzzyLe, fuzzyGt, and fuzzyGe).
Declared in <bdlb_doublecompareutil.h>
static
DoubleCompareUtil::CompareResult
fuzzyCompare(
double a,
double b);