From def0ef29f15fe8f0c765e102e8b3557024da53e6 Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Thu, 12 Jan 2023 09:31:29 +0000 Subject: [PATCH] Fix SFixed conversion by making ShiftType signed (#100) `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: