Skip to content

mp_units::utility::pow

Power function with runtime exponent

Synopsis

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

[[nodiscard]] constexpr uncertain pow(uncertain const& base, value_type const& exponent)
  requires requires { pow(base.value(), exponent); } || requires { std::pow(base.value(), exponent); };

Description

NOTE

Formula: if f = x^n, then σf = |n × x^(n-1) × σx| = |n × f/x × σ_x|

NOTE

This is a first-order approximation valid for small relative uncertainties.

Return Value

uncertain Result with propagated uncertainty

Note

The return value should not be discarded.

Parameters

NameDescription
baseThe uncertain value to raise to a power
exponentThe exponent (exact value, no uncertainty)