[#mp_units-inverse-09]
= xref:mp_units.adoc[mp&lowbar;units]::inverse
:relfileprefix: ../
:mrdocs:

Computes the inverse of a quantity in a provided unit

== Synopsis

Declared in `&lt;mp&hyphen;units&sol;math&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/Unit.adoc[Unit] auto To,
    auto R,
    typename Rep&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
xref:mp_units/Quantity-0c.adoc[Quantity] auto
inverse(xref:mp_units/quantity-01.adoc[quantity&lt;R, Rep&gt;] const& q)
requires requires &lcub;
    representation&lowbar;values&lt;Rep&gt;&colon;&colon;one()&semi;
    value&lowbar;cast&lt;To&gt;(representation&lowbar;values&lt;Rep&gt;&colon;&colon;one() &sol; q)&semi;
  &rcub;;
----

== Return Value

the inverse of `q,` expressed in unit `To`

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

[cols="1,4"]
|===
| Name| Description
| *q*
| the quantity to invert
|===


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