|
Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
|
#include <hfloat_impl.hpp>
Public Types | |
| typedef bt | BlockType |
| using | frac_t = hfloat_detail::wide<fbits> |
| using | raw_t = hfloat_detail::wide<nbits> |
Public Member Functions | |
| hfloat ()=default | |
| trivial constructor | |
| hfloat (const hfloat &)=default | |
| hfloat (hfloat &&)=default | |
| hfloat & | operator= (const hfloat &)=default |
| hfloat & | operator= (hfloat &&)=default |
| constexpr | hfloat (const SpecificValue code) noexcept |
| constexpr | hfloat (signed char iv) noexcept |
| constexpr | hfloat (short iv) noexcept |
| constexpr | hfloat (int iv) noexcept |
| constexpr | hfloat (long iv) noexcept |
| constexpr | hfloat (long long iv) noexcept |
| constexpr | hfloat (char iv) noexcept |
| constexpr | hfloat (unsigned short iv) noexcept |
| constexpr | hfloat (unsigned int iv) noexcept |
| constexpr | hfloat (unsigned long iv) noexcept |
| constexpr | hfloat (unsigned long long iv) noexcept |
| constexpr | hfloat (float iv) noexcept |
| constexpr | hfloat (double iv) noexcept |
| constexpr hfloat & | operator= (signed char rhs) noexcept |
| constexpr hfloat & | operator= (short rhs) noexcept |
| constexpr hfloat & | operator= (int rhs) noexcept |
| constexpr hfloat & | operator= (long rhs) noexcept |
| constexpr hfloat & | operator= (long long rhs) noexcept |
| constexpr hfloat & | operator= (char rhs) noexcept |
| constexpr hfloat & | operator= (unsigned short rhs) noexcept |
| constexpr hfloat & | operator= (unsigned int rhs) noexcept |
| constexpr hfloat & | operator= (unsigned long rhs) noexcept |
| constexpr hfloat & | operator= (unsigned long long rhs) noexcept |
| constexpr hfloat & | operator= (float rhs) noexcept |
| constexpr hfloat & | operator= (double rhs) noexcept |
| constexpr | operator float () const noexcept |
| constexpr | operator double () const noexcept |
| constexpr hfloat & | assign_from_mantissa64 (bool negative, int bin_exp, uint64_t mantissa64) noexcept |
| template<unsigned BigBits> | |
| constexpr hfloat & | assign_from_wide_mantissa (bool negative, int bin_exp, const ::sw::universal::decimal_to_binary::basic_result< BigBits > &d) noexcept |
| constexpr hfloat | operator- () const |
| constexpr hfloat & | operator+= (const hfloat &rhs) |
| constexpr hfloat & | operator-= (const hfloat &rhs) |
| constexpr hfloat & | operator*= (const hfloat &rhs) |
| constexpr hfloat & | operator/= (const hfloat &rhs) |
| constexpr hfloat & | operator++ () |
| constexpr hfloat | operator++ (int) |
| constexpr hfloat & | operator-- () |
| constexpr hfloat | operator-- (int) |
| constexpr void | clear () noexcept |
| constexpr void | setzero () noexcept |
| constexpr void | setsign (bool negative=true) noexcept |
| constexpr void | setbits (uint64_t value) noexcept |
| constexpr hfloat & | maxpos () noexcept |
| constexpr hfloat & | minpos () noexcept |
| constexpr hfloat & | zero () noexcept |
| constexpr hfloat & | minneg () noexcept |
| constexpr hfloat & | maxneg () noexcept |
| constexpr bool | sign () const noexcept |
| constexpr bool | iszero () const noexcept |
| constexpr bool | isone () const noexcept |
| constexpr bool | ispos () const noexcept |
| constexpr bool | isneg () const noexcept |
| constexpr bool | isinf () const noexcept |
| constexpr bool | isnan () const noexcept |
| constexpr bool | isnan (int) const noexcept |
| constexpr int | scale () const noexcept |
| std::string | str (size_t nrDigits=0) const |
| constexpr bool | getbit (unsigned pos) const noexcept |
| constexpr void | decode (bool &s, int &exponent, frac_t &fraction) const noexcept |
| constexpr void | decode_normalized (bool &s, int &exponent, frac_t &fraction) const noexcept |
| constexpr void | unpack (bool &s, int &exponent, uint64_t &fraction) const noexcept |
Static Public Attributes | |
| static constexpr unsigned | ndigits = _ndigits |
| static constexpr unsigned | es = _es |
| static constexpr unsigned | fbits = ndigits * 4u |
| static constexpr unsigned | nbits = 1u + es + fbits |
| static constexpr int | bias = (1 << (es - 1)) |
| static constexpr int | emax = (1 << es) - 1 - bias |
| static constexpr int | emin = -bias |
| static constexpr unsigned | bitsInByte = 8u |
| static constexpr unsigned | bitsInBlock = sizeof(bt) * bitsInByte |
| static constexpr unsigned | nrBlocks = 1u + ((nbits - 1u) / bitsInBlock) |
| static constexpr unsigned | MSU = nrBlocks - 1u |
| static constexpr bt | ALL_ONES = bt(~0) |
| static constexpr bt | MSU_MASK = (nrBlocks * bitsInBlock == nbits) ? ALL_ONES : bt((1ull << (nbits % bitsInBlock)) - 1u) |
| static constexpr bt | BLOCK_MASK = bt(~0) |
| static constexpr unsigned | wide64 = (fbits > 64u) ? fbits : 64u |
Protected Member Functions | |
| constexpr void | setbit (unsigned pos, bool value) noexcept |
| constexpr raw_t | load () const noexcept |
| constexpr void | store (const raw_t &r) noexcept |
| template<unsigned C> | |
| constexpr void | encode (bool s, int exponent, const hfloat_detail::wide< C > &F) noexcept |
| template<unsigned C> | |
| constexpr void | normalize_chop (bool s, int e, hfloat_detail::wide< C > f, int P) noexcept |
| constexpr hfloat & | convert_ieee754 (double rhs) noexcept |
| constexpr double | convert_to_double () const noexcept |
| constexpr hfloat & | convert_long_double (long double rhs) noexcept |
| constexpr hfloat & | convert_signed (int64_t v) noexcept |
| constexpr hfloat & | convert_unsigned (uint64_t v) noexcept |
| constexpr hfloat & | assign_scaled (bool negative, uint64_t m, int E) noexcept |
Static Protected Member Functions | |
| static constexpr int | floor_div4 (int b) noexcept |
Protected Attributes | |
| bt | _block [nrBlocks] |
Friends | |
| template<unsigned N, unsigned E, typename B> | |
| constexpr bool | operator== (const hfloat< N, E, B > &lhs, const hfloat< N, E, B > &rhs) |
| template<unsigned N, unsigned E, typename B> | |
| constexpr bool | operator== (const hfloat< N, E, B > &lhs, const double rhs) |
| template<unsigned N, unsigned E, typename B> | |
| constexpr bool | operator== (const double lhs, const hfloat< N, E, B > &rhs) |
| typedef bt sw::universal::hfloat< _ndigits, _es, bt >::BlockType |
| using sw::universal::hfloat< _ndigits, _es, bt >::frac_t = hfloat_detail::wide<fbits> |
| using sw::universal::hfloat< _ndigits, _es, bt >::raw_t = hfloat_detail::wide<nbits> |
|
default |
trivial constructor
|
default |
|
default |
|
inlineconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprprotectednoexcept |
|
inlinestaticconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineexplicitconstexprnoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
default |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
default |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprprotectednoexcept |
|
inline |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
friend |
|
friend |
|
friend |
|
protected |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |