[#mp_units-round-0c] = xref:mp_units.adoc[mp_units]::round :relfileprefix: ../ :mrdocs: Computes the nearest quantity point with integer representation and unit type `To` to `qp` == Synopsis Declared in `<mp‐units/math.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< xref:mp_units/Unit.adoc[Unit] auto To, auto R, auto PO, typename Rep> [[nodiscard]] constexpr xref:mp_units/QuantityPointOf.adoc[QuantityPointOf<quantity_point<R, PO, Rep>::quantity_spec>] auto round(xref:mp_units/quantity_point-08.adoc[quantity_point<R, PO, Rep>] const& qp) noexcept requires requires { mp_units::floor<To>(qp); representation_values<Rep>::one(); } && std::constructible_from<std::int64_t, Rep>; ---- == Description Returns the value `res` representable in `To` unit that is the closest to `qp`. If there are two such values, returns the even value (that is, the value `res` such that `res % 2 == 0`). == Return Value QuantityPoint The quantity rounded to the nearest unit `To`, rounding to even in halfway cases. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *qp* | Quantity point being the base of the operation |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#