diff --git a/src/FixedPoints/SFixed0MemberFunctions.h b/src/FixedPoints/SFixed0MemberFunctions.h index 52372c4..d79e3ec 100644 --- a/src/FixedPoints/SFixed0MemberFunctions.h +++ b/src/FixedPoints/SFixed0MemberFunctions.h @@ -68,8 +68,8 @@ constexpr typename SFixed<0, Fraction>::InternalType SFixed<0, Fraction>::getInt template< unsigned Fraction > constexpr typename SFixed<0, Fraction>::IntegerType SFixed<0, Fraction>::getInteger(void) const { - static_assert(false, "UNDEFINED BEHAVIOUR"); - //return (static_cast(this->value >> IntegerShift) & IntegerMask) | ((this->value < 0) ? ~IntegerMask : 0); + //static_assert(false, "UNDEFINED BEHAVIOUR"); + return (static_cast(this->value >> IntegerShift) & IntegerMask) | ((this->value < 0) ? ~IntegerMask : 0); } template< unsigned Fraction > @@ -172,7 +172,7 @@ template< unsigned Fraction > SFixed<0, Fraction> & SFixed<0, Fraction>::operator *=(const SFixed<0, Fraction> & other) { using InternalType = typename SFixed<0, Fraction>::InternalType; - using PrecisionType = typename SFixed::InternalType; + using PrecisionType = typename SFixed<0, Fraction * 2>::InternalType; const PrecisionType temp = (static_cast(this->value) * static_cast(other.value)) >> Fraction; this->value = static_cast(temp); return *this; @@ -182,7 +182,7 @@ template< unsigned Fraction > SFixed<0, Fraction> & SFixed<0, Fraction>::operator /=(const SFixed<0, Fraction> & other) { using InternalType = typename SFixed<0, Fraction>::InternalType; - using PrecisionType = typename SFixed::InternalType; + using PrecisionType = typename SFixed<0, Fraction * 2>::InternalType; const PrecisionType temp = (static_cast(this->value) << Fraction) / static_cast(other.value); this->value = static_cast(temp); return *this;