From 64ffe27c2ad3215e4f6e67777b1a1126f88a848b Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 19 Oct 2025 02:40:35 +0300 Subject: [PATCH] Fix abs(fixed_point), lmao --- libs/util/include/psemek/util/fixed_point.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; }