asserts.notApprox
Check that two numeric values are not approximately equal.
📝Syntax
asserts.notApprox(computed, expected, relTol)
asserts.notApprox(computed, expected, relTol, absTol)
[res, msg] = asserts.notApprox(computed, expected, relTol)
📥Input Arguments
Parameter Description
computed Computed numeric value.
expected Value that must not be approximately equal to computed.
relTol Nonnegative finite relative tolerance.
absTol Optional nonnegative finite absolute tolerance.
📤Output Arguments
Parameter Description
res true if the assertion passes, false otherwise.
msg assertion failure message, empty on success.
📄Description

The assertion passes when asserts.isapprox would fail.

Both tolerances must be finite nonnegative numeric scalars.

💡Examples
Different numeric values
asserts.notApprox(1, 2, eps);
Capture approximate equality
[res, msg] = asserts.notApprox(1, 1, eps);
🔗See Also
asserts.isapprox
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub