Expect.toApproximatelyEqual

Succeeds if `received.isClose(expected, maxRelDiff, maxAbsDiff)`. Throws a FailingExpectationError otherwise.

maxRelDiff and maxAbsDiff have the same default values as in std.math.isClose.

struct Expect(TReceived)
void
toApproximatelyEqual
(
TExpected
F : real
)
(
const auto ref TExpected expected
,
F maxRelDiff = CommonDefaultFor!(TReceived, TExpected)
,
F maxAbsDiff = 0.0
)
if (
__traits(compiles, received.isClose(expected, maxRelDiff, maxAbsDiff))
)

See Also

Meta