Scale value by the unit magnitude passed as m, converting to type To, with the result rounded according to policy.
Declared in <mp-units/framework/scaling.h>
template<
typename To,
UnitMagnitude M,
typename From,
RoundingPolicy Policy>
requires detail::UnitMagnitudeScalable<From>
[[nodiscard]]
constexpr
auto
scale(
M m,
From const& value,
Policy policy);
value scaled by m, rounded to type To according to policy
The return value should not be discarded.
| Name | Description |
|---|---|
| m | unit magnitude to scale value by |
| value | value being scaled |
| policy | rounding policy tag selecting how the scaled result is rounded |