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::unum_lattice< esizesize, fsizesize > Struct Template Reference

#include <lattice.hpp>

Static Public Member Functions

static constexpr double pow2 (int n) noexcept
static CONSTEXPRESSION int ilogb (double a) noexcept
static constexpr double maxpos () noexcept
static CONSTEXPRESSION double spacing (double a) noexcept
static CONSTEXPRESSION double floor (double a) noexcept
static CONSTEXPRESSION double ceil (double a) noexcept
static CONSTEXPRESSION double next (double v) noexcept
static CONSTEXPRESSION double prev (double v) noexcept

Static Public Attributes

static constexpr int maxfs = (1 << fsizesize) - 1
static constexpr int esmax = (1 << esizesize) - 1
static constexpr int emax = esmax < 30 ? (1 << esmax) : (1 << 30)
static constexpr int emin = 2 - emax
static constexpr bool fits_double = (maxfs <= 52) && (emax <= 256) && (emin - maxfs >= -512)

Member Function Documentation

◆ ceil()

template<unsigned esizesize, unsigned fsizesize>
CONSTEXPRESSION double sw::universal::unum_lattice< esizesize, fsizesize >::ceil ( double a)
inlinestaticnoexcept

◆ floor()

template<unsigned esizesize, unsigned fsizesize>
CONSTEXPRESSION double sw::universal::unum_lattice< esizesize, fsizesize >::floor ( double a)
inlinestaticnoexcept

◆ ilogb()

template<unsigned esizesize, unsigned fsizesize>
CONSTEXPRESSION int sw::universal::unum_lattice< esizesize, fsizesize >::ilogb ( double a)
inlinestaticnoexcept

◆ maxpos()

template<unsigned esizesize, unsigned fsizesize>
constexpr double sw::universal::unum_lattice< esizesize, fsizesize >::maxpos ( )
inlinestaticconstexprnoexcept

◆ next()

template<unsigned esizesize, unsigned fsizesize>
CONSTEXPRESSION double sw::universal::unum_lattice< esizesize, fsizesize >::next ( double v)
inlinestaticnoexcept

◆ pow2()

template<unsigned esizesize, unsigned fsizesize>
constexpr double sw::universal::unum_lattice< esizesize, fsizesize >::pow2 ( int n)
inlinestaticconstexprnoexcept

◆ prev()

template<unsigned esizesize, unsigned fsizesize>
CONSTEXPRESSION double sw::universal::unum_lattice< esizesize, fsizesize >::prev ( double v)
inlinestaticnoexcept

◆ spacing()

template<unsigned esizesize, unsigned fsizesize>
CONSTEXPRESSION double sw::universal::unum_lattice< esizesize, fsizesize >::spacing ( double a)
inlinestaticnoexcept

Member Data Documentation

◆ emax

template<unsigned esizesize, unsigned fsizesize>
int sw::universal::unum_lattice< esizesize, fsizesize >::emax = esmax < 30 ? (1 << esmax) : (1 << 30)
staticconstexpr

◆ emin

template<unsigned esizesize, unsigned fsizesize>
int sw::universal::unum_lattice< esizesize, fsizesize >::emin = 2 - emax
staticconstexpr

◆ esmax

template<unsigned esizesize, unsigned fsizesize>
int sw::universal::unum_lattice< esizesize, fsizesize >::esmax = (1 << esizesize) - 1
staticconstexpr

◆ fits_double

template<unsigned esizesize, unsigned fsizesize>
bool sw::universal::unum_lattice< esizesize, fsizesize >::fits_double = (maxfs <= 52) && (emax <= 256) && (emin - maxfs >= -512)
staticconstexpr

◆ maxfs

template<unsigned esizesize, unsigned fsizesize>
int sw::universal::unum_lattice< esizesize, fsizesize >::maxfs = (1 << fsizesize) - 1
staticconstexpr

The documentation for this struct was generated from the following file:
  • /home/runner/work/universal/universal/include/sw/universal/number/unum/lattice.hpp