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