diff --git a/src/core/include/units/magnitude.h b/src/core/include/units/magnitude.h
index c9013bd1..58ae46df 100644
--- a/src/core/include/units/magnitude.h
+++ b/src/core/include/units/magnitude.h
@@ -290,6 +290,16 @@ constexpr auto operator*(magnitude
, magnitude) {
// Shortcut for the "pure prepend" case, which makes it easier to implement some of the other cases.
if constexpr ((sizeof...(T1) == 0) && H1.get_base() < H2.get_base()) { return magnitude{}; }
+ // Case for when H1 has the smaller base.
+ if constexpr(H1.get_base() < H2.get_base()){
+ return magnitude{} * (magnitude{} * magnitude{});
+ }
+
+ // Case for when H2 has the smaller base.
+ if constexpr(H1.get_base() > H2.get_base()){
+ return magnitude{} * (magnitude{} * magnitude{});
+ }
+
// "Same leading base" case.
if constexpr (H1.get_base() == H2.get_base()) {
constexpr auto partial_product = magnitude{} * magnitude{};
@@ -306,16 +316,6 @@ constexpr auto operator*(magnitude, magnitude) {
return magnitude{} * partial_product;
}
}
-
- // Case for when H1 has the smaller base.
- if constexpr(H1.get_base() < H2.get_base()){
- return magnitude{} * (magnitude{} * magnitude{});
- }
-
- // Case for when H2 has the smaller base.
- if constexpr(H1.get_base() > H2.get_base()){
- return magnitude{} * (magnitude{} * magnitude{});
- }
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////