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

`inverse` overloads

== Synopses

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

Computes the inverse of a dimension&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
xref:mp_units/Unit.adoc[Unit] auto
xref:mp_units/inverse-0d.adoc[inverse](auto d);
----

[.small]#xref:mp_units/inverse-0d.adoc[_» more&period;&period;&period;_]#

Computes the inverse of a reference


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
consteval
&sol;&ast; implementation-defined &ast;&sol;
xref:mp_units/inverse-0b.adoc[inverse](xref:mp_units/reference-0b2.adoc[reference] r);
----

[.small]#xref:mp_units/inverse-0b.adoc[_» more&period;&period;&period;_]#

Computes the inverse of a quantity in a provided unit


[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
xref:mp_units/inverse-09.adoc[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;;
----

[.small]#xref:mp_units/inverse-09.adoc[_» more&period;&period;&period;_]#

== Return Value

* `dimension&lowbar;one &sol; d`
* the result of the computation
* 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
| *d*
| the dimension to invert
| *r*
| reference being inverted
| *q*
| the quantity to invert
|===


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