Fix bug in IdentityMask calculation (#99)

The bit width of the type was not being sufficiently increased, which was leading to dropped bits, which in turn caused problems with floating point conversion and possibly other problems.
pull/100/head
Pharap 2 years ago committed by GitHub
parent 5411bf0a73
commit 79ef8398f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/FixedPoints/Details.h

@ -126,7 +126,7 @@ namespace FIXED_POINTS_DETAILS
struct IdentityMask
{
IdentityMask() = delete;
static constexpr LeastUInt<Bits> Value = 1 | (IdentityMask<Bits - 1>::Value << 1);
static constexpr LeastUInt<Bits> Value = 1 | (static_cast<LeastUInt<Bits>>(IdentityMask<Bits - 1>::Value) << 1);
};
template<>

Loading…
Cancel
Save