Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt > Class Template Reference

#include <fixpnt_impl.hpp>

Public Types

typedef bt BlockType

Public Member Functions

 fixpnt () noexcept=default
 fixpnt (const fixpnt &) noexcept=default
 fixpnt (fixpnt &&) noexcept=default
constexpr fixpnt & operator= (const fixpnt &) noexcept=default
constexpr fixpnt & operator= (fixpnt &&) noexcept=default
template<unsigned src_nbits, unsigned src_rbits>
constexpr fixpnt (const fixpnt< src_nbits, src_rbits, arithmetic, bt > &a) noexcept
 construct a new fixpnt from another, sign extend or round when necessary: src and tgt fixpnt need to have the same arithmetic and blocktype
constexpr fixpnt (const SpecificValue code)
template<unsigned nnbits, typename Bbt>
constexpr fixpnt & operator= (const blockbinary< nnbits, Bbt > &rhs)
template<unsigned src_nbits, unsigned src_rbits>
constexpr fixpnt & operator= (const fixpnt< src_nbits, src_rbits, arithmetic, bt > &a) noexcept
constexpr fixpnt (signed char initial_value) noexcept
constexpr fixpnt (short initial_value) noexcept
constexpr fixpnt (int initial_value) noexcept
constexpr fixpnt (long initial_value) noexcept
constexpr fixpnt (long long initial_value) noexcept
constexpr fixpnt (char initial_value) noexcept
constexpr fixpnt (unsigned short initial_value) noexcept
constexpr fixpnt (unsigned int initial_value) noexcept
constexpr fixpnt (unsigned long initial_value) noexcept
constexpr fixpnt (unsigned long long initial_value) noexcept
BIT_CAST_CONSTEXPR fixpnt (float initial_value) noexcept
BIT_CAST_CONSTEXPR fixpnt (double initial_value) noexcept
constexpr fixpnt & operator= (signed char rhs) noexcept
constexpr fixpnt & operator= (short rhs) noexcept
constexpr fixpnt & operator= (int rhs) noexcept
constexpr fixpnt & operator= (long rhs) noexcept
constexpr fixpnt & operator= (long long rhs) noexcept
constexpr fixpnt & operator= (char rhs) noexcept
constexpr fixpnt & operator= (unsigned short rhs) noexcept
constexpr fixpnt & operator= (unsigned int rhs) noexcept
constexpr fixpnt & operator= (unsigned long rhs) noexcept
constexpr fixpnt & operator= (unsigned long long rhs) noexcept
BIT_CAST_CONSTEXPR fixpnt & operator= (float rhs) noexcept
BIT_CAST_CONSTEXPR fixpnt & operator= (double rhs) noexcept
fixpnt & assign (const std::string &number)
constexpr fixpnt operator- () const
constexpr fixpnt operator~ () const
constexpr fixpnt operator++ (int)
constexpr fixpnt & operator++ ()
constexpr fixpnt operator-- (int)
constexpr fixpnt & operator-- ()
constexpr operator unsigned short () const noexcept
constexpr operator unsigned int () const noexcept
constexpr operator unsigned long () const noexcept
constexpr operator unsigned long long () const noexcept
constexpr operator short () const noexcept
constexpr operator int () const noexcept
constexpr operator long () const noexcept
constexpr operator long long () const noexcept
constexpr operator float () const noexcept
constexpr operator double () const noexcept
constexpr fixpnt & operator+= (const fixpnt &rhs)
constexpr fixpnt & operator-= (const fixpnt &rhs)
constexpr fixpnt & operator*= (const fixpnt &rhs)
constexpr fixpnt & operator/= (const fixpnt &rhs)
 Divide this fixpnt by rhs in-place.
constexpr fixpnt & operator%= (const fixpnt &rhs)
constexpr fixpnt & operator<<= (const signed shift)
constexpr fixpnt & operator>>= (const signed shift)
constexpr void clear () noexcept
constexpr void setzero () noexcept
constexpr void setbit (unsigned bitIndex, bool v=true) noexcept
constexpr void setbits (uint64_t value) noexcept
constexpr fixpnt & minpos () noexcept
constexpr fixpnt & maxpos () noexcept
constexpr fixpnt & zero () noexcept
constexpr fixpnt & minneg () noexcept
constexpr fixpnt & maxneg () noexcept
constexpr fixpnt & flip () noexcept
constexpr fixpnt & twosComplement () noexcept
constexpr bool sign () const noexcept
constexpr fixpnt integer () const noexcept
constexpr fixpnt fraction () const noexcept
constexpr bool iszero () const noexcept
constexpr bool ispos () const noexcept
constexpr bool isneg () const noexcept
constexpr bool isnan () const noexcept
constexpr bool isinf () const noexcept
constexpr bool at (unsigned bitIndex) const noexcept
constexpr bool test (unsigned bitIndex) const noexcept
constexpr uint8_t nibble (unsigned n) const noexcept
constexpr blockbinary< nbits, bt, BinaryNumberType::Signed > bits () const noexcept
template<typename TargetBlockType = bt>
void normalize (blocktriple< rbits, BlockTripleOperator::REP, TargetBlockType > &tgt) const

Static Public Attributes

static constexpr unsigned nbits = _nbits
static constexpr unsigned rbits = _rbits
static constexpr unsigned fbits = _rbits
static constexpr bool arithmetic = _arithmetic
static constexpr unsigned bitsInChar = 8
static constexpr unsigned bitsInBlock = sizeof(bt) * bitsInChar
static constexpr unsigned nrBlocks = (1 + ((nbits - 1) / bitsInBlock))
static constexpr unsigned MSU = nrBlocks - 1
static constexpr bt MSU_MASK = bt(bt(~0) >> (nrBlocks * bitsInBlock - nbits))

Protected Member Functions

template<typename NativeInt>
constexpr NativeInt to_integer () const noexcept
template<typename NativeInt>
constexpr std::enable_if< std::is_integral_v< NativeInt > &&std::is_signed_v< NativeInt >, NativeInt >::type to_signed () const
template<typename NativeInt>
constexpr std::enable_if< std::is_unsigned_v< NativeInt >, NativeInt >::type to_unsigned () const
template<typename TargetFloat>
constexpr TargetFloat to_native () const

Static Protected Member Functions

template<typename Real>
static constexpr Real exact_pow2 (int e)
template<typename Arith>
static constexpr fixpnt convert (Arith v)

Friends

template<unsigned nnbits, unsigned rrbits, bool aarithmetic, typename Bbt>
std::string convert_to_decimal_string (const fixpnt< nnbits, rrbits, aarithmetic, Bbt > &value)
template<unsigned nnbits, unsigned rrbits, bool aarithmetic, typename Bbt>
constexpr bool operator== (const fixpnt< nnbits, rrbits, aarithmetic, Bbt > &lhs, const fixpnt< nnbits, rrbits, aarithmetic, Bbt > &rhs)
template<unsigned nnbits, unsigned rrbits, bool aarithmetic, typename Bbt>
constexpr bool operator< (const fixpnt< nnbits, rrbits, aarithmetic, Bbt > &lhs, const fixpnt< nnbits, rrbits, aarithmetic, Bbt > &rhs)

Member Typedef Documentation

◆ BlockType

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
typedef bt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::BlockType

Constructor & Destructor Documentation

◆ fixpnt() [1/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( )
defaultnoexcept

◆ fixpnt() [2/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( const fixpnt< _nbits, _rbits, _arithmetic, bt > & )
defaultnoexcept

◆ fixpnt() [3/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( fixpnt< _nbits, _rbits, _arithmetic, bt > && )
defaultnoexcept

◆ fixpnt() [4/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<unsigned src_nbits, unsigned src_rbits>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( const fixpnt< src_nbits, src_rbits, arithmetic, bt > & a)
inlineconstexprnoexcept

construct a new fixpnt from another, sign extend or round when necessary: src and tgt fixpnt need to have the same arithmetic and blocktype

Parameters
asource fixpnt

◆ fixpnt() [5/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( const SpecificValue code)
inlineconstexpr

◆ fixpnt() [6/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( signed char initial_value)
inlineconstexprnoexcept

◆ fixpnt() [7/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( short initial_value)
inlineconstexprnoexcept

◆ fixpnt() [8/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( int initial_value)
inlineconstexprnoexcept

◆ fixpnt() [9/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( long initial_value)
inlineconstexprnoexcept

◆ fixpnt() [10/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( long long initial_value)
inlineconstexprnoexcept

◆ fixpnt() [11/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( char initial_value)
inlineconstexprnoexcept

◆ fixpnt() [12/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( unsigned short initial_value)
inlineconstexprnoexcept

◆ fixpnt() [13/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( unsigned int initial_value)
inlineconstexprnoexcept

◆ fixpnt() [14/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( unsigned long initial_value)
inlineconstexprnoexcept

◆ fixpnt() [15/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( unsigned long long initial_value)
inlineconstexprnoexcept

◆ fixpnt() [16/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
BIT_CAST_CONSTEXPR sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( float initial_value)
inlinenoexcept

◆ fixpnt() [17/17]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
BIT_CAST_CONSTEXPR sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fixpnt ( double initial_value)
inlinenoexcept

Member Function Documentation

◆ assign()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::assign ( const std::string & number)
inline

◆ at()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::at ( unsigned bitIndex) const
inlineconstexprnoexcept

◆ bits()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
blockbinary< nbits, bt, BinaryNumberType::Signed > sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::bits ( ) const
inlineconstexprnoexcept

◆ clear()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
void sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::clear ( )
inlineconstexprnoexcept

◆ convert()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<typename Arith>
constexpr fixpnt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::convert ( Arith v)
inlinestaticconstexprprotected

◆ exact_pow2()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<typename Real>
constexpr Real sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::exact_pow2 ( int e)
inlinestaticconstexprprotected

◆ flip()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::flip ( )
inlineconstexprnoexcept

◆ fraction()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fraction ( ) const
inlineconstexprnoexcept

◆ integer()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::integer ( ) const
inlineconstexprnoexcept

◆ isinf()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::isinf ( ) const
inlineconstexprnoexcept

◆ isnan()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::isnan ( ) const
inlineconstexprnoexcept

◆ isneg()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::isneg ( ) const
inlineconstexprnoexcept

◆ ispos()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::ispos ( ) const
inlineconstexprnoexcept

◆ iszero()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::iszero ( ) const
inlineconstexprnoexcept

◆ maxneg()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::maxneg ( )
inlineconstexprnoexcept

◆ maxpos()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::maxpos ( )
inlineconstexprnoexcept

◆ minneg()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::minneg ( )
inlineconstexprnoexcept

◆ minpos()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::minpos ( )
inlineconstexprnoexcept

◆ nibble()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
uint8_t sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::nibble ( unsigned n) const
inlineconstexprnoexcept

◆ normalize()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<typename TargetBlockType = bt>
void sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::normalize ( blocktriple< rbits, BlockTripleOperator::REP, TargetBlockType > & tgt) const
inline

◆ operator double()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator double ( ) const
inlineexplicitconstexprnoexcept

◆ operator float()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator float ( ) const
inlineexplicitconstexprnoexcept

◆ operator int()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator int ( ) const
inlineexplicitconstexprnoexcept

◆ operator long()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator long ( ) const
inlineexplicitconstexprnoexcept

◆ operator long long()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator long long ( ) const
inlineexplicitconstexprnoexcept

◆ operator short()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator short ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned int()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator unsigned int ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned long()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator unsigned long ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned long long()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator unsigned long long ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned short()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator unsigned short ( ) const
inlineexplicitconstexprnoexcept

◆ operator%=()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator%= ( const fixpnt< _nbits, _rbits, _arithmetic, bt > & rhs)
inlineconstexpr

◆ operator*=()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator*= ( const fixpnt< _nbits, _rbits, _arithmetic, bt > & rhs)
inlineconstexpr

◆ operator++() [1/2]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator++ ( )
inlineconstexpr

◆ operator++() [2/2]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator++ ( int )
inlineconstexpr

◆ operator+=()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator+= ( const fixpnt< _nbits, _rbits, _arithmetic, bt > & rhs)
inlineconstexpr

◆ operator-()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator- ( ) const
inlineconstexpr

◆ operator--() [1/2]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator-- ( )
inlineconstexpr

◆ operator--() [2/2]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator-- ( int )
inlineconstexpr

◆ operator-=()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator-= ( const fixpnt< _nbits, _rbits, _arithmetic, bt > & rhs)
inlineconstexpr

◆ operator/=()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator/= ( const fixpnt< _nbits, _rbits, _arithmetic, bt > & rhs)
inlineconstexpr

Divide this fixpnt by rhs in-place.

In Modulo mode, the result wraps on overflow. In Saturate mode, the result clamps to maxpos or maxneg on overflow.

◆ operator<<=()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator<<= ( const signed shift)
inlineconstexpr

◆ operator=() [1/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( char rhs)
inlineconstexprnoexcept

◆ operator=() [2/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<unsigned nnbits, typename Bbt>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( const blockbinary< nnbits, Bbt > & rhs)
inlineconstexpr

◆ operator=() [3/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( const fixpnt< _nbits, _rbits, _arithmetic, bt > & )
constexprdefaultnoexcept

◆ operator=() [4/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<unsigned src_nbits, unsigned src_rbits>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( const fixpnt< src_nbits, src_rbits, arithmetic, bt > & a)
inlineconstexprnoexcept

◆ operator=() [5/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
BIT_CAST_CONSTEXPR fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( double rhs)
inlinenoexcept

◆ operator=() [6/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( fixpnt< _nbits, _rbits, _arithmetic, bt > && )
constexprdefaultnoexcept

◆ operator=() [7/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
BIT_CAST_CONSTEXPR fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( float rhs)
inlinenoexcept

◆ operator=() [8/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( int rhs)
inlineconstexprnoexcept

◆ operator=() [9/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( long long rhs)
inlineconstexprnoexcept

◆ operator=() [10/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( long rhs)
inlineconstexprnoexcept

◆ operator=() [11/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( short rhs)
inlineconstexprnoexcept

◆ operator=() [12/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( signed char rhs)
inlineconstexprnoexcept

◆ operator=() [13/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( unsigned int rhs)
inlineconstexprnoexcept

◆ operator=() [14/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( unsigned long long rhs)
inlineconstexprnoexcept

◆ operator=() [15/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( unsigned long rhs)
inlineconstexprnoexcept

◆ operator=() [16/16]

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator= ( unsigned short rhs)
inlineconstexprnoexcept

◆ operator>>=()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator>>= ( const signed shift)
inlineconstexpr

◆ operator~()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::operator~ ( ) const
inlineconstexpr

◆ setbit()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
void sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::setbit ( unsigned bitIndex,
bool v = true )
inlineconstexprnoexcept

◆ setbits()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
void sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::setbits ( uint64_t value)
inlineconstexprnoexcept

◆ setzero()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
void sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::setzero ( )
inlineconstexprnoexcept

◆ sign()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::sign ( ) const
inlineconstexprnoexcept

◆ test()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::test ( unsigned bitIndex) const
inlineconstexprnoexcept

◆ to_integer()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<typename NativeInt>
NativeInt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::to_integer ( ) const
inlineconstexprprotectednoexcept

◆ to_native()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<typename TargetFloat>
TargetFloat sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::to_native ( ) const
inlineconstexprprotected

◆ to_signed()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<typename NativeInt>
std::enable_if< std::is_integral_v< NativeInt > &&std::is_signed_v< NativeInt >, NativeInt >::type sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::to_signed ( ) const
inlineconstexprprotected

◆ to_unsigned()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<typename NativeInt>
std::enable_if< std::is_unsigned_v< NativeInt >, NativeInt >::type sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::to_unsigned ( ) const
inlineconstexprprotected

◆ twosComplement()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::twosComplement ( )
inlineconstexprnoexcept

◆ zero()

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
fixpnt & sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::zero ( )
inlineconstexprnoexcept

◆ convert_to_decimal_string

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<unsigned nnbits, unsigned rrbits, bool aarithmetic, typename Bbt>
std::string convert_to_decimal_string ( const fixpnt< nnbits, rrbits, aarithmetic, Bbt > & value)
friend

◆ operator<

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<unsigned nnbits, unsigned rrbits, bool aarithmetic, typename Bbt>
bool operator< ( const fixpnt< nnbits, rrbits, aarithmetic, Bbt > & lhs,
const fixpnt< nnbits, rrbits, aarithmetic, Bbt > & rhs )
friend

◆ operator==

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
template<unsigned nnbits, unsigned rrbits, bool aarithmetic, typename Bbt>
bool operator== ( const fixpnt< nnbits, rrbits, aarithmetic, Bbt > & lhs,
const fixpnt< nnbits, rrbits, aarithmetic, Bbt > & rhs )
friend

Member Data Documentation

◆ arithmetic

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bool sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::arithmetic = _arithmetic
staticconstexpr

◆ bitsInBlock

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
unsigned sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::bitsInBlock = sizeof(bt) * bitsInChar
staticconstexpr

◆ bitsInChar

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
unsigned sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::bitsInChar = 8
staticconstexpr

◆ fbits

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
unsigned sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::fbits = _rbits
staticconstexpr

◆ MSU

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
unsigned sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::MSU = nrBlocks - 1
staticconstexpr

◆ MSU_MASK

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
bt sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::MSU_MASK = bt(bt(~0) >> (nrBlocks * bitsInBlock - nbits))
staticconstexpr

◆ nbits

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
unsigned sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::nbits = _nbits
staticconstexpr

◆ nrBlocks

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
unsigned sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::nrBlocks = (1 + ((nbits - 1) / bitsInBlock))
staticconstexpr

◆ rbits

template<unsigned _nbits, unsigned _rbits, bool _arithmetic = Modulo, typename bt = uint8_t>
unsigned sw::universal::fixpnt< _nbits, _rbits, _arithmetic, bt >::rbits = _rbits
staticconstexpr

The documentation for this class was generated from the following files:
  • /home/runner/work/universal/universal/include/sw/universal/number/fixpnt/fixpnt_fwd.hpp
  • /home/runner/work/universal/universal/include/sw/universal/number/fixpnt/fixpnt_impl.hpp