Skip to content

Commit def0ef2

Browse files
authored
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.
1 parent b61dd1a commit def0ef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FixedPoints/SFixed.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SFixed
4444

4545
static constexpr uintmax_t InternalSize = FIXED_POINTS_DETAILS::BitSize<InternalType>::Value;
4646

47-
using ShiftType = FIXED_POINTS_DETAILS::LeastUInt<LogicalSize>;
47+
using ShiftType = FIXED_POINTS_DETAILS::LeastInt<LogicalSize>;
4848
using MaskType = FIXED_POINTS_DETAILS::LeastUInt<LogicalSize>;
4949

5050
public:

0 commit comments

Comments
 (0)