
I just noticed an issue with AlmostEqualWithError, something like 1.2E16.AlmostEqualWithError(1.3E16, 1E9) returns false, because the method decides to test by relative error.
From my point of view the abs/rel error decision should be changed from...
if (Math.Abs(a) < _doubleMachinePrecision  Math.Abs(b) < _doubleMachinePrecision)
return AlmostEqualWithAbsoluteError(a, b, diff, maximumError);
to
if (Math.Abs(a) < maximumError  Math.Abs(b) < maximumError)
return AlmostEqualWithAbsoluteError(a, b, diff, maximumError);
Andy



Hi Andy
Yes, this sounds reasonable, I consider to apply the change.
Those who explicitly need either absolute or relative error testing should use the alternative methods anyway, which remain unaffected by this change.
Thanks,
Chris

