fix: inverse of magnitude fixed

This commit is contained in:
Mateusz Pusz
2022-11-07 16:12:31 -10:00
parent a97eea95e9
commit 5142365ec6

View File

@@ -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.