Skip to content

num::basic_tolerance

Defined in header <core/types.hpp>

template <std::floating_point T>
struct basic_tolerance;

Stopping tolerance: \(e \le \max(\mathrm{rtol}\,|s|,\ \mathrm{atol})\). \(e\) is the error and \(s\) its scale. Set fields by name, e.g. {.rtol = 1e-8}; omitted fields are zero.

Notes

NaN never passes.

Members

member description
T rtol = T(0)
T atol = T(0)
constexpr T bound(T scale) const noexcept
constexpr bool met(T error, T scale) const noexcept
constexpr bool valid() const noexcept Test whether the tolerance can be met: finite, nonnegative, not both zero.