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¶
| Name | Description |
|---|---|
| base | The uncertain value to raise to a power |
| exponent | The exponent (exact value, no uncertainty) |