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::blockdigit< _ndigits, _radix, DigitType > Class Template Reference

#include <blockdigit.hpp>

Public Types

using Digit = DigitType

Public Member Functions

 blockdigit ()=default
 blockdigit (const blockdigit &)=default
 blockdigit (blockdigit &&)=default
blockdigit & operator= (const blockdigit &)=default
blockdigit & operator= (blockdigit &&)=default
constexpr blockdigit (const SpecificValue code) noexcept
 blockdigit (signed char initial_value)
 blockdigit (short initial_value)
 blockdigit (int initial_value)
 blockdigit (long initial_value)
 blockdigit (long long initial_value)
 blockdigit (unsigned char initial_value)
 blockdigit (unsigned short initial_value)
 blockdigit (unsigned int initial_value)
 blockdigit (unsigned long initial_value)
 blockdigit (unsigned long long initial_value)
 blockdigit (float initial_value)
 blockdigit (double initial_value)
blockdigit & operator= (signed char rhs)
blockdigit & operator= (short rhs)
blockdigit & operator= (int rhs)
blockdigit & operator= (long rhs)
blockdigit & operator= (long long rhs)
blockdigit & operator= (unsigned char rhs)
blockdigit & operator= (unsigned short rhs)
blockdigit & operator= (unsigned int rhs)
blockdigit & operator= (unsigned long rhs)
blockdigit & operator= (unsigned long long rhs)
blockdigit & operator= (float rhs)
blockdigit & operator= (double rhs)
 operator long long () const noexcept
 operator unsigned long long () const noexcept
 operator int () const noexcept
 operator long () const noexcept
 operator unsigned int () const noexcept
 operator unsigned long () const noexcept
 operator float () const noexcept
 operator double () const noexcept
blockdigit operator- () const
blockdigit & operator++ ()
blockdigit operator++ (int)
blockdigit & operator-- ()
blockdigit operator-- (int)
blockdigit & operator+= (const blockdigit &rhs)
blockdigit & operator-= (const blockdigit &rhs)
blockdigit & operator*= (const blockdigit &rhs)
blockdigit & operator/= (const blockdigit &rhs)
blockdigit & operator%= (const blockdigit &rhs)
blockdigit & operator<<= (int shift)
blockdigit & operator>>= (int shift)
void clear ()
void setzero ()
void setdigit (unsigned index, DigitType value)
void setsign (bool s)
void setneg ()
void setpos ()
void setbits (uint64_t v)
constexpr blockdigit & minpos () noexcept
constexpr blockdigit & maxpos () noexcept
constexpr blockdigit & zero () noexcept
constexpr blockdigit & minneg () noexcept
constexpr blockdigit & maxneg () noexcept
bool iszero () const
bool sign () const
bool isneg () const
bool ispos () const
DigitType digit (unsigned index) const
int findMsd () const
unsigned significant_digits () const
std::string to_string () const

Static Public Attributes

static constexpr unsigned ndigits = _ndigits
static constexpr unsigned radix = _radix

Friends

template<unsigned N, unsigned R, typename D>
bool operator== (const blockdigit< N, R, D > &lhs, const blockdigit< N, R, D > &rhs)
template<unsigned N, unsigned R, typename D>
bool operator< (const blockdigit< N, R, D > &lhs, const blockdigit< N, R, D > &rhs)
template<unsigned N, unsigned R, typename D>
std::ostream & operator<< (std::ostream &ostr, const blockdigit< N, R, D > &v)

Member Typedef Documentation

◆ Digit

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
using sw::universal::blockdigit< _ndigits, _radix, DigitType >::Digit = DigitType

Constructor & Destructor Documentation

◆ blockdigit() [1/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( )
default

◆ blockdigit() [2/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( const blockdigit< _ndigits, _radix, DigitType > & )
default

◆ blockdigit() [3/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( blockdigit< _ndigits, _radix, DigitType > && )
default

◆ blockdigit() [4/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( const SpecificValue code)
inlineconstexprnoexcept

◆ blockdigit() [5/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( signed char initial_value)
inline

◆ blockdigit() [6/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( short initial_value)
inline

◆ blockdigit() [7/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( int initial_value)
inline

◆ blockdigit() [8/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( long initial_value)
inline

◆ blockdigit() [9/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( long long initial_value)
inline

◆ blockdigit() [10/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( unsigned char initial_value)
inline

◆ blockdigit() [11/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( unsigned short initial_value)
inline

◆ blockdigit() [12/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( unsigned int initial_value)
inline

◆ blockdigit() [13/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( unsigned long initial_value)
inline

◆ blockdigit() [14/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( unsigned long long initial_value)
inline

◆ blockdigit() [15/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( float initial_value)
inline

◆ blockdigit() [16/16]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::blockdigit ( double initial_value)
inline

Member Function Documentation

◆ clear()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
void sw::universal::blockdigit< _ndigits, _radix, DigitType >::clear ( )
inline

◆ digit()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
DigitType sw::universal::blockdigit< _ndigits, _radix, DigitType >::digit ( unsigned index) const
inline

◆ findMsd()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
int sw::universal::blockdigit< _ndigits, _radix, DigitType >::findMsd ( ) const
inline

◆ isneg()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
bool sw::universal::blockdigit< _ndigits, _radix, DigitType >::isneg ( ) const
inline

◆ ispos()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
bool sw::universal::blockdigit< _ndigits, _radix, DigitType >::ispos ( ) const
inline

◆ iszero()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
bool sw::universal::blockdigit< _ndigits, _radix, DigitType >::iszero ( ) const
inline

◆ maxneg()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::maxneg ( )
inlineconstexprnoexcept

◆ maxpos()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::maxpos ( )
inlineconstexprnoexcept

◆ minneg()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::minneg ( )
inlineconstexprnoexcept

◆ minpos()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::minpos ( )
inlineconstexprnoexcept

◆ operator double()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator double ( ) const
inlineexplicitnoexcept

◆ operator float()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator float ( ) const
inlineexplicitnoexcept

◆ operator int()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator int ( ) const
inlineexplicitnoexcept

◆ operator long()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator long ( ) const
inlineexplicitnoexcept

◆ operator long long()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator long long ( ) const
inlineexplicitnoexcept

◆ operator unsigned int()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator unsigned int ( ) const
inlineexplicitnoexcept

◆ operator unsigned long()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator unsigned long ( ) const
inlineexplicitnoexcept

◆ operator unsigned long long()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator unsigned long long ( ) const
inlineexplicitnoexcept

◆ operator%=()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator%= ( const blockdigit< _ndigits, _radix, DigitType > & rhs)
inline

◆ operator*=()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator*= ( const blockdigit< _ndigits, _radix, DigitType > & rhs)
inline

◆ operator++() [1/2]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator++ ( )
inline

◆ operator++() [2/2]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator++ ( int )
inline

◆ operator+=()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator+= ( const blockdigit< _ndigits, _radix, DigitType > & rhs)
inline

◆ operator-()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator- ( ) const
inline

◆ operator--() [1/2]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator-- ( )
inline

◆ operator--() [2/2]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator-- ( int )
inline

◆ operator-=()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator-= ( const blockdigit< _ndigits, _radix, DigitType > & rhs)
inline

◆ operator/=()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator/= ( const blockdigit< _ndigits, _radix, DigitType > & rhs)
inline

◆ operator<<=()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator<<= ( int shift)
inline

◆ operator=() [1/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( blockdigit< _ndigits, _radix, DigitType > && )
default

◆ operator=() [2/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( const blockdigit< _ndigits, _radix, DigitType > & )
default

◆ operator=() [3/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( double rhs)
inline

◆ operator=() [4/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( float rhs)
inline

◆ operator=() [5/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( int rhs)
inline

◆ operator=() [6/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( long long rhs)
inline

◆ operator=() [7/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( long rhs)
inline

◆ operator=() [8/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( short rhs)
inline

◆ operator=() [9/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( signed char rhs)
inline

◆ operator=() [10/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( unsigned char rhs)
inline

◆ operator=() [11/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( unsigned int rhs)
inline

◆ operator=() [12/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( unsigned long long rhs)
inline

◆ operator=() [13/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( unsigned long rhs)
inline

◆ operator=() [14/14]

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator= ( unsigned short rhs)
inline

◆ operator>>=()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::operator>>= ( int shift)
inline

◆ setbits()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
void sw::universal::blockdigit< _ndigits, _radix, DigitType >::setbits ( uint64_t v)
inline

◆ setdigit()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
void sw::universal::blockdigit< _ndigits, _radix, DigitType >::setdigit ( unsigned index,
DigitType value )
inline

◆ setneg()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
void sw::universal::blockdigit< _ndigits, _radix, DigitType >::setneg ( )
inline

◆ setpos()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
void sw::universal::blockdigit< _ndigits, _radix, DigitType >::setpos ( )
inline

◆ setsign()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
void sw::universal::blockdigit< _ndigits, _radix, DigitType >::setsign ( bool s)
inline

◆ setzero()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
void sw::universal::blockdigit< _ndigits, _radix, DigitType >::setzero ( )
inline

◆ sign()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
bool sw::universal::blockdigit< _ndigits, _radix, DigitType >::sign ( ) const
inline

◆ significant_digits()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
unsigned sw::universal::blockdigit< _ndigits, _radix, DigitType >::significant_digits ( ) const
inline

◆ to_string()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
std::string sw::universal::blockdigit< _ndigits, _radix, DigitType >::to_string ( ) const
inline

◆ zero()

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
blockdigit & sw::universal::blockdigit< _ndigits, _radix, DigitType >::zero ( )
inlineconstexprnoexcept

◆ operator<

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
template<unsigned N, unsigned R, typename D>
bool operator< ( const blockdigit< N, R, D > & lhs,
const blockdigit< N, R, D > & rhs )
friend

◆ operator<<

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
template<unsigned N, unsigned R, typename D>
std::ostream & operator<< ( std::ostream & ostr,
const blockdigit< N, R, D > & v )
friend

◆ operator==

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
template<unsigned N, unsigned R, typename D>
bool operator== ( const blockdigit< N, R, D > & lhs,
const blockdigit< N, R, D > & rhs )
friend

Member Data Documentation

◆ ndigits

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
unsigned sw::universal::blockdigit< _ndigits, _radix, DigitType >::ndigits = _ndigits
staticconstexpr

◆ radix

template<unsigned _ndigits, unsigned _radix = 10, typename DigitType = uint8_t>
unsigned sw::universal::blockdigit< _ndigits, _radix, DigitType >::radix = _radix
staticconstexpr

The documentation for this class was generated from the following file:
  • /home/runner/work/universal/universal/include/sw/universal/internal/blockdigit/blockdigit.hpp