[#mp_units-get_relative_standard_uncertainty]
= xref:mp_units.adoc[mp&lowbar;units]::get&lowbar;relative&lowbar;standard&lowbar;uncertainty
:relfileprefix: ../
:mrdocs:

Returns the relative standard uncertainty of a measured constant

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;framework&sol;unit&lowbar;definitions&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;xref:mp_units/MeasuredConstant.adoc[MeasuredConstant] U&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
xref:mp_units/UnitMagnitude.adoc[UnitMagnitude] auto
get&lowbar;relative&lowbar;standard&lowbar;uncertainty(U u);
----

== Description

For a constant declared with `standard&lowbar;uncertainty`, the result is derived as the exact ratio of the uncertainty&apos;s canonical magnitude to the constant&apos;s one (`u&lowbar;r &equals; u(x)&sol;&verbar;x&verbar;`, so the result never carries a sign even for a negative&hyphen;valued constant)&period;

There is no valid result for constants that are exact by definition&period; Asking for one would conflate &quot;exact by definition&quot; with &quot;measured infinitely precisely&quot;, so it is a compile&hyphen;time error rather than a zero magnitude&period;

== Return Value

the relative standard uncertainty of `u`

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *u*
| the measured constant
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
