From af827ca50f4df51fe36ce60d36665801e985af5e Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Sat, 26 Aug 2023 19:27:48 +0200 Subject: [PATCH] refactor: small math functions refactoring to make clang happy --- src/utility/include/mp-units/math.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utility/include/mp-units/math.h b/src/utility/include/mp-units/math.h index 2df2fa950..278c59ad9 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); }