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::positFraction< fbits, bt > Class Template Reference

#include <posit_fraction.hpp>

Public Member Functions

constexpr positFraction ()
constexpr positFraction (const positFraction &f)=default
constexpr positFraction (positFraction &&f)=default
constexpr positFraction & operator= (const positFraction &f)=default
constexpr positFraction & operator= (positFraction &&f)=default
constexpr bool none () const
constexpr UnsignedFraction bits () const noexcept
constexpr unsigned nrBits () const noexcept
constexpr long double value () const
constexpr void reset ()
constexpr void setzero ()
constexpr void set (const UnsignedFraction &raw, unsigned nrOfFractionBits=fbits)
UnsignedSignificant get_fixed_point () const
void denormalize (int shift, blockbinary< fbits+3, bt, BinaryNumberType::Unsigned > &number) const

Friends

template<unsigned nfbits, typename bbt>
std::ostream & operator<< (std::ostream &ostr, const positFraction< nfbits, bbt > &f)
template<unsigned nfbits, typename bbt>
bool operator== (const positFraction< nfbits, bbt > &lhs, const positFraction< nfbits, bbt > &rhs)
template<unsigned nfbits, typename bbt>
bool operator!= (const positFraction< nfbits, bbt > &lhs, const positFraction< nfbits, bbt > &rhs)
template<unsigned nfbits, typename bbt>
bool operator< (const positFraction< nfbits, bbt > &lhs, const positFraction< nfbits, bbt > &rhs)
template<unsigned nfbits, typename bbt>
bool operator> (const positFraction< nfbits, bbt > &lhs, const positFraction< nfbits, bbt > &rhs)
template<unsigned nfbits, typename bbt>
bool operator<= (const positFraction< nfbits, bbt > &lhs, const positFraction< nfbits, bbt > &rhs)
template<unsigned nfbits, typename bbt>
bool operator>= (const positFraction< nfbits, bbt > &lhs, const positFraction< nfbits, bbt > &rhs)

Constructor & Destructor Documentation

◆ positFraction() [1/3]

template<unsigned fbits, typename bt>
sw::universal::positFraction< fbits, bt >::positFraction ( )
inlineconstexpr

◆ positFraction() [2/3]

template<unsigned fbits, typename bt>
sw::universal::positFraction< fbits, bt >::positFraction ( const positFraction< fbits, bt > & f)
constexprdefault

◆ positFraction() [3/3]

template<unsigned fbits, typename bt>
sw::universal::positFraction< fbits, bt >::positFraction ( positFraction< fbits, bt > && f)
constexprdefault

Member Function Documentation

◆ bits()

template<unsigned fbits, typename bt>
UnsignedFraction sw::universal::positFraction< fbits, bt >::bits ( ) const
inlineconstexprnoexcept

◆ denormalize()

template<unsigned fbits, typename bt>
void sw::universal::positFraction< fbits, bt >::denormalize ( int shift,
blockbinary< fbits+3, bt, BinaryNumberType::Unsigned > & number ) const
inline

◆ get_fixed_point()

template<unsigned fbits, typename bt>
UnsignedSignificant sw::universal::positFraction< fbits, bt >::get_fixed_point ( ) const
inline

◆ none()

template<unsigned fbits, typename bt>
bool sw::universal::positFraction< fbits, bt >::none ( ) const
inlineconstexpr

◆ nrBits()

template<unsigned fbits, typename bt>
unsigned sw::universal::positFraction< fbits, bt >::nrBits ( ) const
inlineconstexprnoexcept

◆ operator=() [1/2]

template<unsigned fbits, typename bt>
positFraction & sw::universal::positFraction< fbits, bt >::operator= ( const positFraction< fbits, bt > & f)
constexprdefault

◆ operator=() [2/2]

template<unsigned fbits, typename bt>
positFraction & sw::universal::positFraction< fbits, bt >::operator= ( positFraction< fbits, bt > && f)
constexprdefault

◆ reset()

template<unsigned fbits, typename bt>
void sw::universal::positFraction< fbits, bt >::reset ( )
inlineconstexpr

◆ set()

template<unsigned fbits, typename bt>
void sw::universal::positFraction< fbits, bt >::set ( const UnsignedFraction & raw,
unsigned nrOfFractionBits = fbits )
inlineconstexpr

◆ setzero()

template<unsigned fbits, typename bt>
void sw::universal::positFraction< fbits, bt >::setzero ( )
inlineconstexpr

◆ value()

template<unsigned fbits, typename bt>
long double sw::universal::positFraction< fbits, bt >::value ( ) const
inlineconstexpr

◆ operator!=

template<unsigned fbits, typename bt>
template<unsigned nfbits, typename bbt>
bool operator!= ( const positFraction< nfbits, bbt > & lhs,
const positFraction< nfbits, bbt > & rhs )
friend

◆ operator<

template<unsigned fbits, typename bt>
template<unsigned nfbits, typename bbt>
bool operator< ( const positFraction< nfbits, bbt > & lhs,
const positFraction< nfbits, bbt > & rhs )
friend

◆ operator<<

template<unsigned fbits, typename bt>
template<unsigned nfbits, typename bbt>
std::ostream & operator<< ( std::ostream & ostr,
const positFraction< nfbits, bbt > & f )
friend

◆ operator<=

template<unsigned fbits, typename bt>
template<unsigned nfbits, typename bbt>
bool operator<= ( const positFraction< nfbits, bbt > & lhs,
const positFraction< nfbits, bbt > & rhs )
friend

◆ operator==

template<unsigned fbits, typename bt>
template<unsigned nfbits, typename bbt>
bool operator== ( const positFraction< nfbits, bbt > & lhs,
const positFraction< nfbits, bbt > & rhs )
friend

◆ operator>

template<unsigned fbits, typename bt>
template<unsigned nfbits, typename bbt>
bool operator> ( const positFraction< nfbits, bbt > & lhs,
const positFraction< nfbits, bbt > & rhs )
friend

◆ operator>=

template<unsigned fbits, typename bt>
template<unsigned nfbits, typename bbt>
bool operator>= ( const positFraction< nfbits, bbt > & lhs,
const positFraction< nfbits, bbt > & rhs )
friend

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