Skip to content

assert

builtin · libnexusinterp/corefcn/error-proprietary.cc

: assert (cond)
: assert (cond, errmsg, …)
: assert (cond, errid, errmsg, …)
: assert (observed, expected)
: assert (observed, expected, tol)

Raise an error when a condition does not hold or two values differ.

A numeric or logical cond holds when it is non-empty and all of its elements are nonzero; the remaining arguments of the first form are passed to error. With observed and expected the values must agree in class, size and content, to within tol (a positive absolute or a negative relative tolerance) when that is given.