mp_units::standard_uncertainty

Absolute standard uncertainty of a measured constant

Synopsis

Declared in <mp-units/framework/unit_definitions.h>

template<Unit U>
struct standard_uncertainty;

Description

Wraps the standard uncertainty (GUM/CODATA u) of a measured constant as an exact symbolic expression of the same shape as the constant's value: a magnitude times a unit of the same dimension. Spelling the unit out makes the expression self-contained - the relative form derives as an exact ratio of two canonical magnitudes, with the units cancelling exactly. Like relative_standard_uncertainty, it is metadata only.

A measured constant declares exactly one of the two wrappers - whichever form its source publishes. Metrology tables (e.g., CODATA) tabulate the absolute uncertainty next to the value, both rounded consistently, so a definition transcribing a table row should use this form; deriving it from a published u_r instead can be off by several percent in the last digit.

For example:


{.cpp}
 inline constexpr struct newtonian_constant_of_gravitation final :
     named_constant<"G", mag_ratio<667'430, 100'000> * mag_power<10, -11> * m3 / kg / s2,
                    standard_uncertainty{mag_ratio<15, 10> * mag_power<10, -15> * m3 / kg / s2}> {}
 newtonian_constant_of_gravitation;

Data Members

Name
unit

Template Parameters

NameDescription
Ua unit expression representing the standard uncertainty in the constant's dimension