round overloads
Declared in <mp-units/math.h>
Computes the nearest quantity with integer representation and unit type To to q
template<
Unit auto To,
auto R,
typename Rep>
[[nodiscard]]
constexpr
quantity<detail::clone_reference_with<To>(R), Rep>
round(quantity<R, Rep> const& q) noexcept
requires requires {
mp_units::floor<To>(q);
representation_values<Rep>::one();
} && std::constructible_from<std::int64_t, Rep>;
» more...
Computes the nearest quantity point with integer representation and unit type To to qp
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>;
» more...
To, rounding to even in halfway cases.To, rounding to even in halfway cases.| Name | Description |
|---|---|
| q | Quantity being the base of the operation |
| Name | Description |
|---|---|
| qp | Quantity point being the base of the operation |