@@ -35,7 +35,7 @@ constexpr typename SFixed<Integer, Fraction>::InternalType SFixed<Integer, Fract
3535template < unsigned Integer, unsigned Fraction >
3636constexpr typename SFixed<Integer, Fraction>::IntegerType SFixed<Integer, Fraction>::getInteger(void ) const
3737{
38- return static_cast <IntegerType>(this ->value >> IntegerShift) & IntegerMask | ((this ->value < 0 ) ? ~IntegerMask : 0 );
38+ return ( static_cast <IntegerType>(this ->value >> IntegerShift) & IntegerMask) | ((this ->value < 0 ) ? ~IntegerMask : 0 );
3939}
4040
4141template < unsigned Integer, unsigned Fraction >
@@ -57,10 +57,6 @@ constexpr SFixed<Integer, Fraction>::operator IntegerType(void) const
5757template < unsigned Integer, unsigned Fraction >
5858constexpr SFixed<Integer, Fraction>::operator float (void ) const
5959{
60- /* return (1.0f / Scale) *
61- (this->value < 0) ?
62- -((-this->value) & IdentityMask) :
63- this->value & IdentityMask; */
6460 return (1 .0f / Scale) *
6561 static_cast <InternalType>
6662 ((this ->value & IdentityMask) |
@@ -70,10 +66,6 @@ constexpr SFixed<Integer, Fraction>::operator float(void) const
7066template < unsigned Integer, unsigned Fraction >
7167constexpr SFixed<Integer, Fraction>::operator double (void ) const
7268{
73- /* return (1.0 / Scale) *
74- (this->value < 0) ?
75- -((-this->value) & IdentityMask) :
76- this->value & IdentityMask; */
7769 return (1.0 / Scale) *
7870 static_cast <InternalType>
7971 ((this ->value & IdentityMask) |
@@ -84,12 +76,11 @@ template< unsigned Integer, unsigned Fraction >
8476template < unsigned IntegerOut, unsigned FractionOut >
8577constexpr SFixed<Integer, Fraction>::operator SFixed<IntegerOut, FractionOut>(void ) const
8678{
87- using OutputType = UFixed <IntegerOut, FractionOut>;
79+ using OutputType = SFixed <IntegerOut, FractionOut>;
8880 using OutputInternalType = typename OutputType::InternalType;
8981 using OutputShiftType = typename OutputType::ShiftType;
9082
91- using InputType = UFixed<Integer, Fraction>;
92- using InputInternalType = typename InputType::InternalType;
83+ using InputType = SFixed<Integer, Fraction>;
9384 using InputShiftType = typename InputType::ShiftType;
9485
9586 return
0 commit comments