First item to compare.
Second item to compare.
Maximum allowable difference relative to rhs. Defaults to 0.5 ^^ 20.
Maximum absolute difference. Defaults to 0.5 ^^ 20.
true if the two items are equal or approximately equal under either criterium.
Complex types works as approxEqual(l.re, r.re) && approxEqual(l.im, r.im)
assert(approxEqual(complex(1.0, 1), complex(1.0000001, 1), 1.0000001)); assert(!approxEqual(complex(100000.0, 0), complex(100001.0, 0)));
Computes whether two values are approximately equal, admitting a maximum relative difference, and a maximum absolute difference.