From ddf9a8309cc0835c9605c3502fc8a0be5b42dde3 Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Thu, 12 Jan 2023 09:29:48 +0000 Subject: [PATCH] Fix SFixed conversion by making ShiftType signed `SFixed`'s conversion operator isn't functioning correctly because the shifting is being done with an unsigned type. This rectifies that by changing `SFixed`'s `ShiftType` to a signed integer type. --- src/FixedPoints/SFixed.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FixedPoints/SFixed.h b/src/FixedPoints/SFixed.h index 93e8154..0cd6a87 100644 --- a/src/FixedPoints/SFixed.h +++ b/src/FixedPoints/SFixed.h @@ -44,7 +44,7 @@ public: static constexpr uintmax_t InternalSize = FIXED_POINTS_DETAILS::BitSize::Value; - using ShiftType = FIXED_POINTS_DETAILS::LeastUInt; + using ShiftType = FIXED_POINTS_DETAILS::LeastInt; using MaskType = FIXED_POINTS_DETAILS::LeastUInt; public: