Your ROOT_URL in app.ini is https://source.parasitstudio.de:63000/ but you are visiting https://source.parasitstudio.de/wirtz/FixedPointsArduino/commit/ea71949e815683b3fbe603221dc8476254cf3c67?style=unified&whitespace=ignore-eol
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
54 additions and
0 deletions
src/FixedPoints/SFixed.h
src/FixedPoints/SFixedMemberFunctions.h
src/FixedPoints/UFixed.h
src/FixedPoints/UFixedMemberFunctions.h
@ -22,6 +22,9 @@ FIXED_POINTS_BEGIN_NAMESPACE
// Declaration
//
template < unsigned Integer , unsigned Fraction >
class UFixed ;
template < unsigned Integer , unsigned Fraction >
class SFixed
{
@ -103,6 +106,11 @@ public:
template < unsigned IntegerOut , unsigned FractionOut >
constexpr explicit operator SFixed < IntegerOut , FractionOut > ( ) const ;
template < unsigned IntegerOut , unsigned FractionOut >
constexpr explicit operator UFixed < IntegerOut , FractionOut > ( ) const ;
constexpr explicit operator UFixed < Integer + 1 , Fraction > ( ) const ;
static constexpr SFixed fromInternal ( const InternalType & value ) ;
constexpr SFixed operator - ( ) const ;
@ -198,6 +198,25 @@ constexpr SFixed<Integer, Fraction>::operator SFixed<IntegerOut, FractionOut>()
OutputType : : fromInternal ( this - > value ) ;
}
template < unsigned Integer , unsigned Fraction >
template < unsigned IntegerOut , unsigned FractionOut >
constexpr SFixed < Integer , Fraction > : : operator UFixed < IntegerOut , FractionOut > ( ) const
{
using OutputType = UFixed < IntegerOut , FractionOut > ;
using IntermediaryType = SFixed < IntegerOut - 1 , FractionOut > ;
return static_cast < OutputType > ( static_cast < IntermediaryType > ( * this ) ) ;
}
template < unsigned Integer , unsigned Fraction >
constexpr SFixed < Integer , Fraction > : : operator UFixed < Integer + 1 , Fraction > ( ) const
{
using OutputType = UFixed < Integer + 1 , Fraction > ;
using OutputInternalType = typename OutputType : : InternalType ;
return OutputType : : fromInternal ( static_cast < OutputInternalType > ( this - > value ) ) ;
}
//
// Static Functions
//
@ -22,6 +22,9 @@ FIXED_POINTS_BEGIN_NAMESPACE
// Declaration
//
template < unsigned Integer , unsigned Fraction >
class SFixed ;
template < unsigned Integer , unsigned Fraction >
class UFixed
{
@ -104,6 +107,11 @@ public:
template < unsigned IntegerOut , unsigned FractionOut >
constexpr explicit operator UFixed < IntegerOut , FractionOut > ( ) const ;
template < unsigned IntegerOut , unsigned FractionOut >
constexpr explicit operator SFixed < IntegerOut , FractionOut > ( ) const ;
constexpr explicit operator SFixed < Integer - 1 , Fraction > ( ) const ;
static constexpr UFixed fromInternal ( const InternalType & value ) ;
UFixed & operator + + ( ) ;
@ -189,6 +189,25 @@ constexpr UFixed<Integer, Fraction>::operator UFixed<IntegerOut, FractionOut>()
OutputType : : fromInternal ( this - > value ) ;
}
template < unsigned Integer , unsigned Fraction >
template < unsigned IntegerOut , unsigned FractionOut >
constexpr UFixed < Integer , Fraction > : : operator SFixed < IntegerOut , FractionOut > ( ) const
{
using OutputType = SFixed < IntegerOut , FractionOut > ;
using IntermediaryType = UFixed < IntegerOut + 1 , FractionOut > ;
return static_cast < OutputType > ( static_cast < IntermediaryType > ( * this ) ) ;
}
template < unsigned Integer , unsigned Fraction >
constexpr UFixed < Integer , Fraction > : : operator SFixed < Integer - 1 , Fraction > ( ) const
{
using OutputType = SFixed < Integer - 1 , Fraction > ;
using OutputInternalType = typename OutputType : : InternalType ;
return OutputType : : fromInternal ( static_cast < OutputInternalType > ( this - > value ) ) ;
}
//
// Static Functions
//