diff --git a/libs/util/include/psemek/util/fixed_point.hpp b/libs/util/include/psemek/util/fixed_point.hpp index 116e480a..472ec7d7 100644 --- a/libs/util/include/psemek/util/fixed_point.hpp +++ b/libs/util/include/psemek/util/fixed_point.hpp @@ -337,9 +337,8 @@ namespace psemek::util constexpr fixed_point abs(fixed_point x) { using FP = fixed_point; - using rep_type = typename FP::rep_type; if constexpr (S) - return FP::from_rep(x.rep() & ~(static_cast(1) << (I + F - 1))); + return FP::from_rep(std::abs(x.rep())); else return x; }