Measurement uncertainty and measured constants
When you write constexpr double G = 6.674e-11; in your code, the type system makes a claim
that is not true. It claims the value is exact. It is not. The Newtonian constant of
gravitation is one of the least precisely known constants in physics. CODATA 2018 lists it
as 6.674 30(15) × 10⁻¹¹ m³ kg⁻¹ s⁻², and the (15) means the fifth significant digit is
already uncertain. Only four digits of G are actually known. Every result derived from
that double inherits an uncertainty that the program neither tracks nor reports. The code
happily prints ten significant digits of a solar mass computed from a constant that
guarantees four.
mp-units now models this honestly. This post introduces the uncertain<T> representation
type, the standard_uncertainty and relative_standard_uncertainty metadata for measured
constants, and the measurement_of helper that connects them.