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::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > Class Template Reference

#include <microfloat_impl.hpp>

Classes

struct  float_fields

Public Member Functions

 microfloat ()=default
constexpr microfloat (const microfloat &)=default
constexpr microfloat (microfloat &&)=default
constexpr microfloat & operator= (const microfloat &)=default
constexpr microfloat & operator= (microfloat &&)=default
constexpr microfloat (const SpecificValue code) noexcept
constexpr microfloat (signed char iv) noexcept
constexpr microfloat (short iv) noexcept
constexpr microfloat (int iv) noexcept
constexpr microfloat (long iv) noexcept
constexpr microfloat (long long iv) noexcept
constexpr microfloat (char iv) noexcept
constexpr microfloat (unsigned short iv) noexcept
constexpr microfloat (unsigned int iv) noexcept
constexpr microfloat (unsigned long iv) noexcept
constexpr microfloat (unsigned long long iv) noexcept
constexpr microfloat (float iv) noexcept
constexpr microfloat (double iv) noexcept
constexpr microfloat & operator= (signed char rhs) noexcept
constexpr microfloat & operator= (short rhs) noexcept
constexpr microfloat & operator= (int rhs) noexcept
constexpr microfloat & operator= (long rhs) noexcept
constexpr microfloat & operator= (long long rhs) noexcept
constexpr microfloat & operator= (char rhs) noexcept
constexpr microfloat & operator= (unsigned short rhs) noexcept
constexpr microfloat & operator= (unsigned int rhs) noexcept
constexpr microfloat & operator= (unsigned long rhs) noexcept
constexpr microfloat & operator= (unsigned long long rhs) noexcept
constexpr microfloat & operator= (float rhs) noexcept
constexpr microfloat & operator= (double rhs) noexcept
constexpr operator float () const noexcept
constexpr operator double () const noexcept
constexpr operator signed char () 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 char () const noexcept
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
template<typename Integer>
constexpr Integer to_integer () const noexcept
constexpr microfloat operator- () const noexcept
constexpr microfloat & operator++ () noexcept
constexpr microfloat operator++ (int) noexcept
constexpr microfloat & operator-- () noexcept
constexpr microfloat operator-- (int) noexcept
constexpr microfloat & operator+= (const microfloat &rhs)
constexpr microfloat & operator-= (const microfloat &rhs)
constexpr microfloat & operator*= (const microfloat &rhs)
constexpr microfloat & operator/= (const microfloat &rhs)
constexpr void clear () noexcept
constexpr void setzero () noexcept
constexpr void setnan (int NaNType=NAN_TYPE_SIGNALLING) noexcept
constexpr void setnan (int NaNType, bool sign) noexcept
constexpr void setoverflow (bool sign) noexcept
constexpr void setinf (bool sign=false) noexcept
constexpr void setbit (unsigned i, bool v=true) noexcept
constexpr void setbits (unsigned value) noexcept
constexpr microfloat & minpos () noexcept
constexpr microfloat & maxpos () noexcept
constexpr microfloat & zero () noexcept
constexpr microfloat & minneg () noexcept
constexpr microfloat & maxneg () noexcept
constexpr bool iszero () const noexcept
constexpr bool isone () const noexcept
constexpr bool isodd () const noexcept
constexpr bool iseven () const noexcept
constexpr bool ispos () const noexcept
constexpr bool isneg () const noexcept
constexpr bool isnan (int NaNType=NAN_TYPE_EITHER) const noexcept
constexpr bool isinf (int InfType=INF_TYPE_EITHER) const noexcept
constexpr bool sign () const noexcept
constexpr int scale () const noexcept
constexpr uint8_t bits () const noexcept
constexpr bool test (unsigned bitIndex) const noexcept
constexpr bool at (unsigned bitIndex) const noexcept
constexpr uint8_t nibble (unsigned n) const noexcept
constexpr uint8_t exponent () const noexcept
constexpr uint8_t fraction () const noexcept
constexpr float to_float () const noexcept
constexpr void from_float (float v) noexcept

Static Public Member Functions

static constexpr float cx_ldexp (float x, int exp) noexcept
static constexpr float_fields extract_float_fields (float v) noexcept

Static Public Attributes

static constexpr unsigned nbits = _nbits
static constexpr unsigned es = _es
static constexpr unsigned fbits = nbits - 1u - es
static constexpr int bias = (1 << (es - 1)) - 1
static constexpr bool hasInf = _hasInf
static constexpr bool hasNaN = _hasNaN
static constexpr bool isSaturating = _isSaturating
static constexpr uint8_t bitmask = static_cast<uint8_t>((1u << nbits) - 1u)
static constexpr uint8_t sign_mask = static_cast<uint8_t>(1u << (nbits - 1u))
static constexpr uint8_t exponent_mask = static_cast<uint8_t>(((1u << es) - 1u) << fbits)
static constexpr uint8_t fraction_mask = static_cast<uint8_t>((1u << fbits) - 1u)
static constexpr unsigned max_exp_code = (1u << es) - 1u

Protected Attributes

uint8_t _bits

Friends

template<unsigned n, unsigned e, bool i, bool na, bool s>
constexpr bool operator== (microfloat< n, e, i, na, s > lhs, microfloat< n, e, i, na, s > rhs)
template<unsigned n, unsigned e, bool i, bool na, bool s>
constexpr bool operator== (microfloat< n, e, i, na, s > lhs, float rhs)
template<unsigned n, unsigned e, bool i, bool na, bool s>
constexpr bool operator== (float lhs, microfloat< n, e, i, na, s > rhs)

Constructor & Destructor Documentation

◆ microfloat() [1/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( )
default

◆ microfloat() [2/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( const microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > & )
constexprdefault

◆ microfloat() [3/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > && )
constexprdefault

◆ microfloat() [4/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( const SpecificValue code)
inlineconstexprnoexcept

◆ microfloat() [5/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( signed char iv)
inlineconstexprnoexcept

◆ microfloat() [6/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( short iv)
inlineconstexprnoexcept

◆ microfloat() [7/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( int iv)
inlineconstexprnoexcept

◆ microfloat() [8/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( long iv)
inlineconstexprnoexcept

◆ microfloat() [9/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( long long iv)
inlineconstexprnoexcept

◆ microfloat() [10/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( char iv)
inlineconstexprnoexcept

◆ microfloat() [11/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( unsigned short iv)
inlineconstexprnoexcept

◆ microfloat() [12/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( unsigned int iv)
inlineconstexprnoexcept

◆ microfloat() [13/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( unsigned long iv)
inlineconstexprnoexcept

◆ microfloat() [14/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( unsigned long long iv)
inlineconstexprnoexcept

◆ microfloat() [15/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( float iv)
inlineexplicitconstexprnoexcept

◆ microfloat() [16/16]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::microfloat ( double iv)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ at()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::at ( unsigned bitIndex) const
inlineconstexprnoexcept

◆ bits()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::bits ( ) const
inlineconstexprnoexcept

◆ clear()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::clear ( )
inlineconstexprnoexcept

◆ cx_ldexp()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
constexpr float sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::cx_ldexp ( float x,
int exp )
inlinestaticconstexprnoexcept

◆ exponent()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::exponent ( ) const
inlineconstexprnoexcept

◆ extract_float_fields()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
constexpr float_fields sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::extract_float_fields ( float v)
inlinestaticconstexprnoexcept

◆ fraction()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::fraction ( ) const
inlineconstexprnoexcept

◆ from_float()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::from_float ( float v)
inlineconstexprnoexcept

◆ iseven()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::iseven ( ) const
inlineconstexprnoexcept

◆ isinf()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::isinf ( int InfType = INF_TYPE_EITHER) const
inlineconstexprnoexcept

◆ isnan()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::isnan ( int NaNType = NAN_TYPE_EITHER) const
inlineconstexprnoexcept

◆ isneg()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::isneg ( ) const
inlineconstexprnoexcept

◆ isodd()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::isodd ( ) const
inlineconstexprnoexcept

◆ isone()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::isone ( ) const
inlineconstexprnoexcept

◆ ispos()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::ispos ( ) const
inlineconstexprnoexcept

◆ iszero()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::iszero ( ) const
inlineconstexprnoexcept

◆ maxneg()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::maxneg ( )
inlineconstexprnoexcept

◆ maxpos()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::maxpos ( )
inlineconstexprnoexcept

◆ minneg()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::minneg ( )
inlineconstexprnoexcept

◆ minpos()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::minpos ( )
inlineconstexprnoexcept

◆ nibble()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::nibble ( unsigned n) const
inlineconstexprnoexcept

◆ operator char()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator char ( ) const
inlineexplicitconstexprnoexcept

◆ operator double()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator double ( ) const
inlineexplicitconstexprnoexcept

◆ operator float()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator float ( ) const
inlineexplicitconstexprnoexcept

◆ operator int()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator int ( ) const
inlineexplicitconstexprnoexcept

◆ operator long()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator long ( ) const
inlineexplicitconstexprnoexcept

◆ operator long long()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator long long ( ) const
inlineexplicitconstexprnoexcept

◆ operator short()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator short ( ) const
inlineexplicitconstexprnoexcept

◆ operator signed char()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator signed char ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned int()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator unsigned int ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned long()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator unsigned long ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned long long()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator unsigned long long ( ) const
inlineexplicitconstexprnoexcept

◆ operator unsigned short()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator unsigned short ( ) const
inlineexplicitconstexprnoexcept

◆ operator*=()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator*= ( const microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > & rhs)
inlineconstexpr

◆ operator++() [1/2]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator++ ( )
inlineconstexprnoexcept

◆ operator++() [2/2]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator++ ( int )
inlineconstexprnoexcept

◆ operator+=()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator+= ( const microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > & rhs)
inlineconstexpr

◆ operator-()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator- ( ) const
inlineconstexprnoexcept

◆ operator--() [1/2]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator-- ( )
inlineconstexprnoexcept

◆ operator--() [2/2]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator-- ( int )
inlineconstexprnoexcept

◆ operator-=()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator-= ( const microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > & rhs)
inlineconstexpr

◆ operator/=()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator/= ( const microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > & rhs)
inlineconstexpr

◆ operator=() [1/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( char rhs)
inlineconstexprnoexcept

◆ operator=() [2/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( const microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > & )
constexprdefault

◆ operator=() [3/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( double rhs)
inlineconstexprnoexcept

◆ operator=() [4/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( float rhs)
inlineconstexprnoexcept

◆ operator=() [5/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( int rhs)
inlineconstexprnoexcept

◆ operator=() [6/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( long long rhs)
inlineconstexprnoexcept

◆ operator=() [7/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( long rhs)
inlineconstexprnoexcept

◆ operator=() [8/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating > && )
constexprdefault

◆ operator=() [9/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( short rhs)
inlineconstexprnoexcept

◆ operator=() [10/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( signed char rhs)
inlineconstexprnoexcept

◆ operator=() [11/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( unsigned int rhs)
inlineconstexprnoexcept

◆ operator=() [12/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( unsigned long long rhs)
inlineconstexprnoexcept

◆ operator=() [13/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( unsigned long rhs)
inlineconstexprnoexcept

◆ operator=() [14/14]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::operator= ( unsigned short rhs)
inlineconstexprnoexcept

◆ scale()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
int sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::scale ( ) const
inlineconstexprnoexcept

◆ setbit()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::setbit ( unsigned i,
bool v = true )
inlineconstexprnoexcept

◆ setbits()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::setbits ( unsigned value)
inlineconstexprnoexcept

◆ setinf()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::setinf ( bool sign = false)
inlineconstexprnoexcept

◆ setnan() [1/2]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::setnan ( int NaNType,
bool sign )
inlineconstexprnoexcept

◆ setnan() [2/2]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::setnan ( int NaNType = NAN_TYPE_SIGNALLING)
inlineconstexprnoexcept

◆ setoverflow()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::setoverflow ( bool sign)
inlineconstexprnoexcept

◆ setzero()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
void sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::setzero ( )
inlineconstexprnoexcept

◆ sign()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::sign ( ) const
inlineconstexprnoexcept

◆ test()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::test ( unsigned bitIndex) const
inlineconstexprnoexcept

◆ to_float()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
float sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::to_float ( ) const
inlineconstexprnoexcept

◆ to_integer()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
template<typename Integer>
Integer sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::to_integer ( ) const
inlineconstexprnoexcept

◆ zero()

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
microfloat & sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::zero ( )
inlineconstexprnoexcept

◆ operator== [1/3]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
template<unsigned n, unsigned e, bool i, bool na, bool s>
bool operator== ( float lhs,
microfloat< n, e, i, na, s > rhs )
friend

◆ operator== [2/3]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
template<unsigned n, unsigned e, bool i, bool na, bool s>
bool operator== ( microfloat< n, e, i, na, s > lhs,
float rhs )
friend

◆ operator== [3/3]

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
template<unsigned n, unsigned e, bool i, bool na, bool s>
bool operator== ( microfloat< n, e, i, na, s > lhs,
microfloat< n, e, i, na, s > rhs )
friend

Member Data Documentation

◆ _bits

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::_bits
protected

◆ bias

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
int sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::bias = (1 << (es - 1)) - 1
staticconstexpr

◆ bitmask

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::bitmask = static_cast<uint8_t>((1u << nbits) - 1u)
staticconstexpr

◆ es

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
unsigned sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::es = _es
staticconstexpr

◆ exponent_mask

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::exponent_mask = static_cast<uint8_t>(((1u << es) - 1u) << fbits)
staticconstexpr

◆ fbits

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
unsigned sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::fbits = nbits - 1u - es
staticconstexpr

◆ fraction_mask

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::fraction_mask = static_cast<uint8_t>((1u << fbits) - 1u)
staticconstexpr

◆ hasInf

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::hasInf = _hasInf
staticconstexpr

◆ hasNaN

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::hasNaN = _hasNaN
staticconstexpr

◆ isSaturating

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
bool sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::isSaturating = _isSaturating
staticconstexpr

◆ max_exp_code

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
unsigned sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::max_exp_code = (1u << es) - 1u
staticconstexpr

◆ nbits

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
unsigned sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::nbits = _nbits
staticconstexpr

◆ sign_mask

template<unsigned _nbits, unsigned _es, bool _hasInf, bool _hasNaN, bool _isSaturating>
uint8_t sw::universal::microfloat< _nbits, _es, _hasInf, _hasNaN, _isSaturating >::sign_mask = static_cast<uint8_t>(1u << (nbits - 1u))
staticconstexpr

The documentation for this class was generated from the following files:
  • /home/runner/work/universal/universal/include/sw/universal/number/microfloat/microfloat_fwd.hpp
  • /home/runner/work/universal/universal/include/sw/universal/number/microfloat/microfloat_impl.hpp