mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-07 06:04:27 +02:00
fix: inverse
of magnitude fixed
This commit is contained in:
@@ -223,9 +223,10 @@ template<PowerVBase auto V, ratio R>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] consteval auto inverse(MagnitudeSpec auto el)
|
template<MagnitudeSpec M>
|
||||||
|
[[nodiscard]] consteval auto inverse(M)
|
||||||
{
|
{
|
||||||
return power_v_or_T<get_base(el), get_exponent(el) * (-1)>();
|
return power_v_or_T<get_base(M{}), -1 * get_exponent(M{})>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// `widen_t` gives the widest arithmetic type in the same category, for intermediate computations.
|
// `widen_t` gives the widest arithmetic type in the same category, for intermediate computations.
|
||||||
|
Reference in New Issue
Block a user