Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
blockbinary.hpp File Reference

Classes

struct  sw::universal::quorem< nbits, BlockType, NumberType >
class  sw::universal::blockbinary< _nbits, bt, _NumberType >

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal

Macros

#define BLOCKBINARY_THROW_ARITHMETIC_EXCEPTION   0
#define BLOCKBINARY_FAST_MUL

Enumerations

enum class  sw::universal::BinaryNumberType { sw::universal::Signed = 0 , sw::universal::Unsigned = 1 }

Functions

template<unsigned nbits, typename BlockType, BinaryNumberType NumberType>
constexpr blockbinary< nbits, BlockType, NumberType > sw::universal::twosComplement (const blockbinary< nbits, BlockType, NumberType > &)
template<unsigned nbits, typename BlockType, BinaryNumberType NumberType>
constexpr quorem< nbits, BlockType, NumberType > sw::universal::longdivision (const blockbinary< nbits, BlockType, NumberType > &, const blockbinary< nbits, BlockType, NumberType > &)
template<unsigned nbits, typename BlockType = uint8_t, BinaryNumberType NumberType>
constexpr blockbinary< nbits, BlockType, NumberType > & sw::universal::maxpos (blockbinary< nbits, BlockType, NumberType > &a)
template<unsigned nbits, typename BlockType = uint8_t, BinaryNumberType NumberType>
constexpr blockbinary< nbits, BlockType, NumberType > & sw::universal::maxneg (blockbinary< nbits, BlockType, NumberType > &a)
template<unsigned srcbits, unsigned tgtbits, typename bt, BinaryNumberType nt>
constexpr void sw::universal::truncate (const blockbinary< srcbits, bt, nt > &src, blockbinary< tgtbits, bt, nt > &tgt)
template<unsigned N, typename B, BinaryNumberType T>
constexpr bool sw::universal::operator== (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)
template<unsigned N, typename B, BinaryNumberType T>
constexpr bool sw::universal::operator!= (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)
template<unsigned N, typename B, BinaryNumberType T>
constexpr bool sw::universal::operator< (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)
template<unsigned N, typename B, BinaryNumberType T>
constexpr bool sw::universal::operator<= (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)
template<unsigned N, typename B, BinaryNumberType T>
constexpr bool sw::universal::operator> (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)
template<unsigned N, typename B, BinaryNumberType T>
constexpr bool sw::universal::operator>= (const blockbinary< N, B, T > &lhs, const blockbinary< N, B, T > &rhs)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< N, B, T > sw::universal::operator+ (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< N, B, T > sw::universal::operator- (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< N, B, T > sw::universal::operator* (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< N, B, T > sw::universal::operator/ (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< N, B, T > sw::universal::operator% (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
blockbinary< N, B, T > sw::universal::operator<< (const blockbinary< N, B, T > &a, long b)
template<unsigned N, typename B, BinaryNumberType T>
blockbinary< N, B, T > sw::universal::operator>> (const blockbinary< N, B, T > &a, long b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr quorem< N, B, T > sw::universal::longdivision (const blockbinary< N, B, T > &dividend, const blockbinary< N, B, T > &divisor)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< N+1, B, T > sw::universal::uradd (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< N+1, B, T > sw::universal::ursub (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< 2 *N, B, T > sw::universal::urmul (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned N, typename B, BinaryNumberType T>
constexpr blockbinary< 2 *N, B, T > sw::universal::urmul2 (const blockbinary< N, B, T > &a, const blockbinary< N, B, T > &b)
template<unsigned nbits, unsigned roundingBits, typename B, BinaryNumberType T>
blockbinary< 2 *nbits+roundingBits, B, T > sw::universal::urdiv (const blockbinary< nbits, B, T > &a, const blockbinary< nbits, B, T > &b)

Macro Definition Documentation

◆ BLOCKBINARY_FAST_MUL

#define BLOCKBINARY_FAST_MUL

◆ BLOCKBINARY_THROW_ARITHMETIC_EXCEPTION

#define BLOCKBINARY_THROW_ARITHMETIC_EXCEPTION   0