Migrate units from ratio to Magnitude
This commit is huge, but hopefully the cognitive load is not too bad. The bulk of this commit is just some fairly mechanical updates from `ratio` to `Magnitude`. Other things to call out: - `UnitRatio` goes away. We don't need this concept, because Magnitude can't even _represent_ anything that doesn't satisfy it. - I commented out some formatting test cases where the precise expression changes, but the number is completely equivalent. We will need to decide how we want to handle Magnitude formatting as a separate, follow-on task. But at least Magnitude gives us all the tools we'll need to do so!
This commit is contained in:
1 parent
5afe7766e9
commit
d19b2803ce
42 files changed
+197
-199
No files matched your search
@@ -37,13 +37,13 @@ namespace detail {
|
||||
|
||||
template<typename D, typename D1, typename U1, typename D2, typename U2>
|
||||
using reference_multiply_impl =
|
||||
reference<D, downcast_unit<D, (U1::ratio / dimension_unit<D1>::ratio) * (U2::ratio / dimension_unit<D2>::ratio) *
|
||||
dimension_unit<D>::ratio>>;
|
||||
reference<D, downcast_unit<D, (U1::mag / dimension_unit<D1>::mag) * (U2::mag / dimension_unit<D2>::mag) *
|
||||
dimension_unit<D>::mag>>;
|
||||
|
||||
template<typename D, typename D1, typename U1, typename D2, typename U2>
|
||||
using reference_divide_impl =
|
||||
reference<D, downcast_unit<D, (U1::ratio / dimension_unit<D1>::ratio) / (U2::ratio / dimension_unit<D2>::ratio) *
|
||||
dimension_unit<D>::ratio>>;
|
||||
reference<D, downcast_unit<D, (U1::mag / dimension_unit<D1>::mag) / (U2::mag / dimension_unit<D2>::mag) *
|
||||
dimension_unit<D>::mag>>;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
Reference in new issue
Block a user