diff --git a/src/utility/include/mp-units/math.h b/src/utility/include/mp-units/math.h index 2df2fa95..278c59ad 100644 --- a/src/utility/include/mp-units/math.h +++ b/src/utility/include/mp-units/math.h @@ -170,7 +170,7 @@ template if constexpr (To == get_unit(R)) { return make_quantity(R)>(static_cast(floor(q.value()))); } else { - return handle_signed_results(make_quantity(q.reference)>( + return handle_signed_results(make_quantity(R)>( static_cast(floor(value_cast(q).value())))); } } else { @@ -205,9 +205,9 @@ template if constexpr (treat_as_floating_point) { using std::ceil; if constexpr (To == get_unit(R)) { - return make_quantity(q.reference)>(static_cast(ceil(q.value()))); + return make_quantity(R)>(static_cast(ceil(q.value()))); } else { - return handle_signed_results(make_quantity(q.reference)>( + return handle_signed_results(make_quantity(R)>( static_cast(ceil(value_cast(q).value())))); } } else { @@ -238,7 +238,7 @@ template if constexpr (To == get_unit(R)) { if constexpr (treat_as_floating_point) { using std::round; - return make_quantity(q.reference)>(static_cast(round(q.value()))); + return make_quantity(R)>(static_cast(round(q.value()))); } else { return value_cast(q); }