scalarApproxRelAndAbs

Check whether the relative error between a and b is smaller than maxEps. If the absolute error is less than maxAbs, the test succeeds however. This is useful when comparing against zero the result of a subtraction.

template scalarApproxRelAndAbs(T)
pure @safe @nogc nothrow
bool
scalarApproxRelAndAbs
(
in T a
,
in T b
,
in T maxAbs = 0.0001
,
in T maxEps = 4 * T.epsilon
)
if (
isFloatingPoint!T
)

Members

Functions

scalarApproxRelAndAbs
bool scalarApproxRelAndAbs(T a, T b, T maxAbs, T maxEps)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta