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::posit_limbs Namespace Reference

Classes

class  efloat_environment_guard
struct  IntegerPart
struct  Fields

Typedefs

template<unsigned nbits>
using efloat_for = efloat<static_cast<unsigned>(2u * limbs(nbits) + 2u)>
using limb_t

Enumerations

enum class  Saturation { none , overflow , both }

Functions

template<unsigned nbits, unsigned es, typename bt>
efloat_for< nbits > to_efloat (const posit< nbits, es, bt > &x)
template<unsigned nbits, unsigned es, typename bt, unsigned nlimbs>
posit< nbits, es, bt > & from_efloat (posit< nbits, es, bt > &p, const efloat< nlimbs > &v)
template<typename Posit, typename Function>
Posit evaluate (Function &&f, Saturation saturation=Saturation::none)
template<unsigned nbits, unsigned es, typename bt>
efloat_for< nbits > argument (const posit< nbits, es, bt > &x, unsigned W)
template<unsigned nbits, unsigned es, typename bt>
IntegerPart< nbits, es, bt > integer_part (const posit< nbits, es, bt > &x, bool wantUp) noexcept
constexpr std::size_t limbs (unsigned bits) noexcept
constexpr bool test (const limb_t *w, unsigned i) noexcept
constexpr void set (limb_t *w, unsigned i) noexcept
constexpr void clear (limb_t *w, unsigned i) noexcept
template<unsigned nbits, typename bt, BinaryNumberType NumberType>
constexpr void gather (const blockbinary< nbits, bt, NumberType > &bits, limb_t *w) noexcept
template<unsigned nbits, unsigned es, typename bt>
void gather (const posit< nbits, es, bt > &a, limb_t *w) noexcept
template<unsigned nbits, unsigned es, typename bt>
constexpr posit< nbits, es, bt > & scatter (posit< nbits, es, bt > &p, const limb_t *w) noexcept
template<unsigned nbits>
constexpr void negate (limb_t *w) noexcept
template<unsigned nbits, unsigned es>
constexpr Fields decode (limb_t *w) noexcept
template<unsigned nbits, unsigned es>
constexpr Fields fields (const limb_t *w) noexcept
template<unsigned nbits, unsigned es, typename bt>
constexpr posit< nbits, es, bt > & encode (posit< nbits, es, bt > &p, int scale, const limb_t *sig, std::size_t n, bool sticky, bool negative=false) noexcept

Typedef Documentation

◆ efloat_for

template<unsigned nbits>
using sw::universal::posit_limbs::efloat_for = efloat<static_cast<unsigned>(2u * limbs(nbits) + 2u)>

◆ limb_t

Enumeration Type Documentation

◆ Saturation

Enumerator
none 
overflow 
both 

Function Documentation

◆ argument()

template<unsigned nbits, unsigned es, typename bt>
efloat_for< nbits > sw::universal::posit_limbs::argument ( const posit< nbits, es, bt > & x,
unsigned W )
inline

◆ clear()

void sw::universal::posit_limbs::clear ( limb_t * w,
unsigned i )
constexprnoexcept

◆ decode()

template<unsigned nbits, unsigned es>
Fields sw::universal::posit_limbs::decode ( limb_t * w)
constexprnoexcept

◆ encode()

template<unsigned nbits, unsigned es, typename bt>
posit< nbits, es, bt > & sw::universal::posit_limbs::encode ( posit< nbits, es, bt > & p,
int scale,
const limb_t * sig,
std::size_t n,
bool sticky,
bool negative = false )
constexprnoexcept

◆ evaluate()

template<typename Posit, typename Function>
Posit sw::universal::posit_limbs::evaluate ( Function && f,
Saturation saturation = Saturation::none )
inline

◆ fields()

template<unsigned nbits, unsigned es>
Fields sw::universal::posit_limbs::fields ( const limb_t * w)
constexprnoexcept

◆ from_efloat()

template<unsigned nbits, unsigned es, typename bt, unsigned nlimbs>
posit< nbits, es, bt > & sw::universal::posit_limbs::from_efloat ( posit< nbits, es, bt > & p,
const efloat< nlimbs > & v )
inline

◆ gather() [1/2]

template<unsigned nbits, typename bt, BinaryNumberType NumberType>
void sw::universal::posit_limbs::gather ( const blockbinary< nbits, bt, NumberType > & bits,
limb_t * w )
constexprnoexcept

◆ gather() [2/2]

template<unsigned nbits, unsigned es, typename bt>
void sw::universal::posit_limbs::gather ( const posit< nbits, es, bt > & a,
limb_t * w )
inlinenoexcept

◆ integer_part()

template<unsigned nbits, unsigned es, typename bt>
IntegerPart< nbits, es, bt > sw::universal::posit_limbs::integer_part ( const posit< nbits, es, bt > & x,
bool wantUp )
inlinenoexcept

◆ limbs()

std::size_t sw::universal::posit_limbs::limbs ( unsigned bits)
constexprnoexcept

◆ negate()

template<unsigned nbits>
void sw::universal::posit_limbs::negate ( limb_t * w)
constexprnoexcept

◆ scatter()

template<unsigned nbits, unsigned es, typename bt>
posit< nbits, es, bt > & sw::universal::posit_limbs::scatter ( posit< nbits, es, bt > & p,
const limb_t * w )
constexprnoexcept

◆ set()

void sw::universal::posit_limbs::set ( limb_t * w,
unsigned i )
constexprnoexcept

◆ test()

bool sw::universal::posit_limbs::test ( const limb_t * w,
unsigned i )
constexprnoexcept

◆ to_efloat()

template<unsigned nbits, unsigned es, typename bt>
efloat_for< nbits > sw::universal::posit_limbs::to_efloat ( const posit< nbits, es, bt > & x)
inline