@ -89,42 +89,17 @@ public:
SFixed & operator / = ( const SFixed & other ) ;
SFixed & operator / = ( const SFixed & other ) ;
public :
public :
const static SFixed Epsilon ;
constexpr const static SFixed Epsilon = SFixed : : fromInternal ( 1 ) ;
const static SFixed MinValue ;
constexpr const static SFixed MinValue = SFixed : : fromInternal ( FIXED_POINTS_DETAILS : : MsbMask < InternalSize > : : Value ) ;
const static SFixed MaxValue ;
constexpr const static SFixed MaxValue = SFixed : : fromInternal ( ~ FIXED_POINTS_DETAILS : : MsbMask < InternalSize > : : Value ) ;
const static SFixed Pi ;
// 40 digits is probably enough for these
const static SFixed E ;
constexpr const static SFixed Pi = 3.1415926535897932384626433832795028841971 ;
const static SFixed Phi ;
constexpr const static SFixed E = 2.718281828459045235360287471352662497757 ;
const static SFixed Tau ;
constexpr const static SFixed Phi = 1.6180339887498948482045868343656381177203 ;
constexpr const static SFixed Tau = 6.2831853071795864769252867665590057683943 ;
} ;
} ;
//
// Variables
//
template < unsigned Integer , unsigned Fraction >
constexpr const SFixed < Integer , Fraction > SFixed < Integer , Fraction > : : Epsilon = SFixed < Integer , Fraction > : : fromInternal ( 1 ) ;
template < unsigned Integer , unsigned Fraction >
constexpr const SFixed < Integer , Fraction > SFixed < Integer , Fraction > : : MinValue = SFixed : : fromInternal ( FIXED_POINTS_DETAILS : : MsbMask < InternalSize > : : Value ) ;
template < unsigned Integer , unsigned Fraction >
constexpr const SFixed < Integer , Fraction > SFixed < Integer , Fraction > : : MaxValue = SFixed : : fromInternal ( ~ FIXED_POINTS_DETAILS : : MsbMask < InternalSize > : : Value ) ;
// 40 digits is probably enough for these
template < unsigned Integer , unsigned Fraction >
constexpr const SFixed < Integer , Fraction > SFixed < Integer , Fraction > : : Pi = 3.1415926535897932384626433832795028841971 ;
template < unsigned Integer , unsigned Fraction >
constexpr const SFixed < Integer , Fraction > SFixed < Integer , Fraction > : : E = 2.718281828459045235360287471352662497757 ;
template < unsigned Integer , unsigned Fraction >
constexpr const SFixed < Integer , Fraction > SFixed < Integer , Fraction > : : Phi = 1.6180339887498948482045868343656381177203 ;
template < unsigned Integer , unsigned Fraction >
constexpr const SFixed < Integer , Fraction > SFixed < Integer , Fraction > : : Tau = 6.2831853071795864769252867665590057683943 ;
//
//
// Free functions
// Free functions