Computes the nearest quantity point with integer representation and unit type To to qp
Declared in <mp-units/math.h>
template<
Unit auto To,
auto R,
auto PO,
typename Rep>
[[nodiscard]]
constexpr
QuantityPointOf<quantity_point<R, PO, Rep>::quantity_spec> auto
round(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>;
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).
QuantityPoint The quantity rounded to the nearest unit To, rounding to even in halfway cases.
The return value should not be discarded.
| Name | Description |
|---|---|
| qp | Quantity point being the base of the operation |