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

Typedefs

using E = efloat<72>

Functions

template<typename Lns>
constexpr E exponentOf (const Lns &v)
template<typename Lns>
constexpr int64_t exponentOf64 (const Lns &v)
template<typename Lns>
constexpr void writeField (Lns &v, E r, bool negative)
template<typename Lns>
constexpr void encode (const E &n, bool negative, Lns &v)
template<typename Lns>
constexpr void encode64 (int64_t k, bool negative, Lns &v)
template<typename Evaluate, typename Margin>
constexpr E nearestByZiv (Evaluate &&evaluate, Margin &&margin, unsigned startBits)
constexpr double roundHalfUp (double x)
template<typename Lns>
constexpr Lns & addsub (Lns &lhs, const Lns &rhs, bool subtract)
template<typename Lns>
Lns exponential (char f, const Lns &x)

Variables

constexpr unsigned zivCap = 2048

Typedef Documentation

◆ E

Function Documentation

◆ addsub()

template<typename Lns>
Lns & sw::universal::lns_rounding::addsub ( Lns & lhs,
const Lns & rhs,
bool subtract )
constexpr

◆ encode()

template<typename Lns>
void sw::universal::lns_rounding::encode ( const E & n,
bool negative,
Lns & v )
constexpr

◆ encode64()

template<typename Lns>
void sw::universal::lns_rounding::encode64 ( int64_t k,
bool negative,
Lns & v )
constexpr

◆ exponential()

template<typename Lns>
Lns sw::universal::lns_rounding::exponential ( char f,
const Lns & x )

◆ exponentOf()

template<typename Lns>
E sw::universal::lns_rounding::exponentOf ( const Lns & v)
constexpr

◆ exponentOf64()

template<typename Lns>
int64_t sw::universal::lns_rounding::exponentOf64 ( const Lns & v)
constexpr

◆ nearestByZiv()

template<typename Evaluate, typename Margin>
E sw::universal::lns_rounding::nearestByZiv ( Evaluate && evaluate,
Margin && margin,
unsigned startBits )
constexpr

◆ roundHalfUp()

double sw::universal::lns_rounding::roundHalfUp ( double x)
constexpr

◆ writeField()

template<typename Lns>
void sw::universal::lns_rounding::writeField ( Lns & v,
E r,
bool negative )
constexpr

Variable Documentation

◆ zivCap

unsigned sw::universal::lns_rounding::zivCap = 2048
inlineconstexpr