Template Function mu::tiny::test::approx_equal(T, T, T)

Function Documentation

template<typename T>
bool mu::tiny::test::approx_equal(T d1, T d2, T threshold)

approx_equal for non-double arithmetic types.

For floating-point T, NaN in any operand returns false. Infinity and signed-overflow edge cases are not handled specially; if you need them, convert to double and call the double overload.

For integral T the comparison is done entirely in integer arithmetic — no conversion to floating-point occurs.