Skip to content

mp_units::utility::metrologically_compatible

Checks whether two measured values agree within their uncertainties

Synopsis

Declared in <mp-units/utility/uncertain.h>

[[nodiscard]] constexpr bool metrologically_compatible(
  uncertain const& lhs, uncertain const& rhs,
  value_type coverage_factor = static_cast<value_type>(2));

Note

This function is a hidden friend of uncertain, declared only inside that class: it can be found only through argument-dependent lookup.

Description

Metrological compatibility (VIM 2.47): |x - y| <= k·√(σx² + σy²). An exact value is the case σ = 0, so the same function checks a measurement against a reference value. The two values are taken as independent. Unlike ==, the relation is not transitive.

Return Value

Note

The return value should not be discarded.

Parameters

NameDescription
coverage_factorThe coverage factor, 2 (about 95 %) by default