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

`round` overloads

== Synopses

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

Computes the nearest quantity with integer representation and unit type `To` to `q`


[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-01.adoc[quantity&lt;detail&colon;&colon;clone&lowbar;reference&lowbar;with&lt;To&gt;(R), Rep&gt;]
xref:mp_units/round-0e.adoc[round](xref:mp_units/quantity-01.adoc[quantity&lt;R, Rep&gt;] const& q) noexcept
requires requires &lcub;
    mp&lowbar;units&colon;&colon;floor&lt;To&gt;(q)&semi;
    representation&lowbar;values&lt;Rep&gt;&colon;&colon;one()&semi;
  &rcub; &amp;&amp; std&colon;&colon;constructible&lowbar;from&lt;std&colon;&colon;int64&lowbar;t, Rep&gt;;
----

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

Computes the nearest quantity point with integer representation and unit type `To` to `qp`


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    xref:mp_units/Unit.adoc[Unit] auto To,
    auto R,
    auto PO,
    typename Rep&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
xref:mp_units/QuantityPointOf.adoc[QuantityPointOf&lt;quantity&lowbar;point&lt;R, PO, Rep&gt;&colon;&colon;quantity&lowbar;spec&gt;] auto
xref:mp_units/round-0c.adoc[round](xref:mp_units/quantity_point-08.adoc[quantity&lowbar;point&lt;R, PO, Rep&gt;] const& qp) noexcept
requires requires &lcub;
    mp&lowbar;units&colon;&colon;floor&lt;To&gt;(qp)&semi;
    representation&lowbar;values&lt;Rep&gt;&colon;&colon;one()&semi;
  &rcub; &amp;&amp; std&colon;&colon;constructible&lowbar;from&lt;std&colon;&colon;int64&lowbar;t, Rep&gt;;
----

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

== Return Value

* Quantity The quantity rounded to the nearest unit `To`, rounding to even in halfway cases&period;
* QuantityPoint The quantity rounded to the nearest unit `To`, rounding to even in halfway cases&period;

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

[cols="1,4"]
|===
| Name| Description
| *q*
| Quantity being the base of the operation
| *qp*
| Quantity point being the base of the operation
|===


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