class Posit
Declaration
template <class T,
int totalbits,
int esbits,
class FT,
posit::PositSpec positspec>
class Posit { /* full declaration omitted */ };Description
Posit value type Stores the posit in the LSB part of the holding type T as signed integer
Operations are implemented at 4 levels: - Level 1: direct manipulation of bit representation - Level 2: decoding of the posit in its componentds (s,k,E,F) - Level 3: decoding and manipulation of the posit in full exponent form (s,X,f) - Level 4: using the posit backend (softfloat by Unpacked, FPU by BackendFloat, fixed point by BackendFixed)
Declared at: include/posit.h:193
Templates
- T
- the holding type that has to be signed due to complement 2 sign method
- int totalbits
- the significant bits of posit stored in T right aligned. Due to the 2 complement scheme the MSB bits are extension of the sign
- int esbits
- the size of the exponent
- FT
- the backend type that can be: unsigned integer for softposit, float/double for emulation, generic Backend, e.g. fixed point
- posit::PositSpec positspec
- specifies the number capabilities
Member Variables
- public T v
- public static Logger<double> _logger
Method Overview
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(posit::Posit::single_tag t, uint32_t p)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(unsigned long long i)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(unsigned long i)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(unsigned int i)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(long long i)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(long i)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(int i)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(posit::Posit::BackendT u)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(posit::Posit::UnpackedPosit u)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(posit::Posit::DeepInit, T x)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>()
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(std::complex<float> c)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(std::complex<double> c)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(float f)
- public constexpr Posit<T, totalbits, esbits, FT, positspec>(double d)
- public constexpr Posit<T, totalbits, esbits, FT, positspec> abs() const
- public constexpr uint32_t as_float_bin() const
- public constexpr bool comparable(const Posit<T, totalbits, esbits, FT, positspec> & u) const
- public template <class It1, class It2>static constexpr Posit<T, totalbits, esbits, FT, positspec> dot(It1 begin1, It2 begin2, int N)
- public constexpr Posit<T, totalbits, esbits, FT, positspec> elu() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> fastELU() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> fastTanh() const
- public template <class XFT>static constexpr Posit<T, totalbits, esbits, FT, positspec> from_floatval(typename XFT::holder_t x)
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> from_sraw(T x)
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> from_uraw(typename PT::POSIT_UTYPE x)
- public constexpr Posit<T, totalbits, esbits, FT, positspec> half() const
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> inf()
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> infinity()
- public constexpr bool is_infinity() const
- public constexpr bool is_nan() const
- public constexpr bool is_one() const
- public constexpr bool is_sphere_range() const
- public constexpr bool is_unitary_range() const
- public constexpr bool is_zero() const
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> ldexp(const Posit<T, totalbits, esbits, FT, positspec> & u, int exp)
- public constexpr Posit<T, totalbits, esbits, FT, positspec> log() const
- public template <class VV>void logValue(VV v)
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> lowest()
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> max()
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> min()
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> mone()
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> nan()
- public constexpr Posit<T, totalbits, esbits, FT, positspec> neg() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> next() const
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> ninf()
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> one()
- public constexpr Posit<T, totalbits, esbits, FT, positspec> one_minus_ur() const
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> onehalf()
- public constexpr bool operator bool() const
- public constexpr std::complex<float> operator complex() const
- public constexpr std::complex<float> operator complex() const
- public constexpr double operator double() const
- public constexpr float operator float() const
- public constexpr int operator int() const
- public constexpr long operator long() const
- public constexpr long long operator long long() const
- public constexpr short operator short() const
- public constexpr signed char operator signed char() const
- public constexpr posit::Posit::BackendT operator typename conditional<is_posit_backend<FT>::value, type-parameter-0-3, typename conditional<std::is_floating_point<FT>::value, BackendFloat<type-parameter-0-3>, Unpacked<type-parameter-0-3, typename PositTrait<type-parameter-0-0, totalbits, esbits, positspec>::exponenttype> >::type>::type() const
- public constexpr unsigned char operator unsigned char() const
- public constexpr unsigned int operator unsigned int() const
- public constexpr unsigned long operator unsigned long() const
- public constexpr unsigned long long operator unsigned long long() const
- public constexpr unsigned short operator unsigned short() const
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> pack_low(posit::Posit::UnpackedPosit)
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> pinf()
- public constexpr Posit<T, totalbits, esbits, FT, positspec> prev() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> pseudosigmoid() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> pseudosigmoidalt() const
- public Posit<T, totalbits, esbits, FT, positspec> pseudosoftplus() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> pseudotanh(int k) const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> pseudotanh() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> reciprocate() const
- public constexpr posit::Posit::BackendT to_backend() const
- public template <class PT2>PT2 to_posit()
- public template <class QuireT>QuireT to_quire()
- public constexpr T to_sraw() const
- public constexpr typename PT::POSIT_UTYPE to_uraw() const
- public constexpr Posit<T, totalbits, esbits, FT, positspec> twice() const
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> two()
- public constexpr posit::Posit::UnpackedPosit unpack_low() const
- public static constexpr posit::Posit::UnpackedPosit unpacked_full2low(posit::Posit::BackendT x)
- public static constexpr posit::Posit::BackendT unpacked_low2full(posit::Posit::UnpackedPosit x)
- public static constexpr Posit<T, totalbits, esbits, FT, positspec> zero()
Methods
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(
posit::Posit::single_tag t,
uint32_t p)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(
posit::Posit::single_tag t,
uint32_t p)Description
Construct the Posit with its backend direct initialization
Declared at: include/posit.h:296
Parameters
- posit::Posit::single_tag t
- uint32_t p
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(unsigned long long i)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(unsigned long long i)Description
Convert the long integer i to Posit
Declared at: include/posit.h:336
Parameters
- unsigned long long i
- 64-bit unsigned integer value
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(unsigned long i)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(unsigned long i)Description
Convert the long integer i to Posit
Declared at: include/posit.h:331
Parameters
- unsigned long i
- 64-bit unsigned integer value
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(unsigned int i)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(unsigned int i)Description
Convert the long integer i to Posit
Declared at: include/posit.h:326
Parameters
- unsigned int i
- 32-bit unsigned integer value
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(long long i)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(long long i)Description
Convert the long integer i to Posit
Declared at: include/posit.h:321
Parameters
- long long i
- 64-bit signed integer value
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(long i)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(long i)Description
Convert the long integer i to Posit
Declared at: include/posit.h:316
Parameters
- long i
- 64-bit signed integer value
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(int i)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(int i)Description
Convert the integer i to Posit
Declared at: include/posit.h:311
Parameters
- int i
- 32-bit signed integer value
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(
posit::Posit::BackendT u)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(
posit::Posit::BackendT u)Description
Construct the Posit from its backend BackendT
Declared at: include/posit.h:305
Parameters
- posit::Posit::BackendT u
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(
posit::Posit::UnpackedPosit u)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(
posit::Posit::UnpackedPosit u)Description
Construct the Posit using its Unpacked from (s, R,E,F)
Declared at: include/posit.h:302
Parameters
- posit::Posit::UnpackedPosit u
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(posit::Posit::DeepInit,
T x)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(posit::Posit::DeepInit,
T x)Description
Construct the Posit passing the holding type x
Declared at: include/posit.h:299
Parameters
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>()
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>()Description
empty constructor
Declared at: include/posit.h:293
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(std::complex<float> c)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(std::complex<float> c)Declared at: include/posit.h:337
Parameters
- std::complex<float> c
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(std::complex<double> c)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(std::complex<double> c)Declared at: include/posit.h:338
Parameters
- std::complex<double> c
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(float f)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(float f)Description
Convert the float number f to Posit
Declared at: include/posit.h:343
Parameters
- float f
- 32-bit float value
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(double d)
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>(double d)Description
Convert the double number d to Posit
Declared at: include/posit.h:348
Parameters
- double d
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
abs() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
abs() constDescription
Compute the absolute value of the Posit (L1)
Declared at: include/posit.h:407
Returns
New Posit containing the absolute value of the initial Posit
¶constexpr uint32_t as_float_bin() const
constexpr uint32_t as_float_bin() constDeclared at: include/posit.h:569
¶constexpr bool comparable(
const Posit<T,
totalbits,
esbits,
FT,
positspec>& u) const
constexpr bool comparable(
const Posit<T,
totalbits,
esbits,
FT,
positspec>& u) constDescription
Returns true if the two Posits are comparable
Declared at: include/posit.h:278
Parameters
- const Posit<T, totalbits, esbits, FT, positspec>& u
¶template <class It1, class It2>
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
dot(It1 begin1, It2 begin2, int N)
template <class It1, class It2>
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
dot(It1 begin1, It2 begin2, int N)Description
computes the dot product between posit values vectors
Declared at: include/posit.h:563
Templates
- It1
- type of first iterator
- It2
- type of second iterator
Parameters
- It1 begin1
- first iterator
- It2 begin2
- second iterator
- int N
- length of vectors
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
elu() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
elu() constDescription
Pseudo-ELU without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:632
Returns
Posit
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
fastELU() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
fastELU() constDescription
Pseudo-ELU without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:655
Returns
Posit
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
fastTanh() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
fastTanh() constDescription
Pseudo-Hyperbolic Tangent without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:649
Returns
Posit
¶template <class XFT>
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
from_floatval(typename XFT::holder_t x)
template <class XFT>
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
from_floatval(typename XFT::holder_t x)Description
Build the Posit from a floating point value expressed as the representing integer
Declared at: include/posit.h:379
Templates
- XFT
- floating point trait type
Parameters
- typename XFT::holder_t x
- floating point representing integer
Returns
Posit built from the floating point conversion
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
from_sraw(T x)
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
from_sraw(T x)Description
Build Posit using its representing signed integer x
Declared at: include/posit.h:384
Parameters
- T x
- signed integer representation of the Posit
Returns
Posit built using its signed integer representation
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
from_uraw(typename PT::POSIT_UTYPE x)
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
from_uraw(typename PT::POSIT_UTYPE x)Description
Build Posit using its representing unsigned integer x
Declared at: include/posit.h:389
Parameters
- typename PT::POSIT_UTYPE x
- unsigned integer representation of the Posit
Returns
Posit built using its unsigned integer representation
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
half() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
half() constDescription
returns half (Level 1)
Declared at: include/posit.h:226
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
inf()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
inf()Declared at: include/posit.h:531
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
infinity()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
infinity()Declared at: include/posit.h:539
¶constexpr bool is_infinity() const
constexpr bool is_infinity() constDescription
returns true if it is any infinity
Declared at: include/posit.h:422
¶constexpr bool is_nan() const
constexpr bool is_nan() constDescription
returns true if the value is NaN
Declared at: include/posit.h:420
¶constexpr bool is_one() const
constexpr bool is_one() constDescription
returns true for one
Declared at: include/posit.h:426
¶constexpr bool is_sphere_range() const
constexpr bool is_sphere_range() constDescription
Check if the Posit is in in the unit interval [-1,1] (Level 1)
Declared at: include/posit.h:440
Returns
True if Posit in the interval [-1,1]
¶constexpr bool is_unitary_range() const
constexpr bool is_unitary_range() constDescription
Check if the Posit is in in the unit interval [0,1] (Level 1)
Declared at: include/posit.h:436
Returns
True if Posit in the interval [0,1]
¶constexpr bool is_zero() const
constexpr bool is_zero() constDescription
returns true for zero
Declared at: include/posit.h:424
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
ldexp(const Posit<T,
totalbits,
esbits,
FT,
positspec>& u,
int exp)
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
ldexp(const Posit<T,
totalbits,
esbits,
FT,
positspec>& u,
int exp)Declared at: include/posit.h:290
Parameters
- const Posit<T, totalbits, esbits, FT, positspec>& u
- int exp
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
log() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
log() constDescription
Natural logarithm of the Posit
Declared at: include/posit.h:612
Returns
Posit
¶template <class VV>
void logValue(VV v)
template <class VV>
void logValue(VV v)Declared at: include/posit.h:202
Templates
- VV
Parameters
- VV v
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
lowest()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
lowest()Declared at: include/posit.h:536
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
max()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
max()Declared at: include/posit.h:534
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
min()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
min()Declared at: include/posit.h:535
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
mone()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
mone()Declared at: include/posit.h:542
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
nan()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
nan()Declared at: include/posit.h:538
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
neg() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
neg() constDescription
Compute the sign opposition of the Posit (L1)
Declared at: include/posit.h:411
Returns
New Posit with the opposite sign of the initial Posit
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
next() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
next() constDescription
Returns next (anti-clockwise in the Posit ring) regular Posit number
Declared at: include/posit.h:432
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
ninf()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
ninf()Declared at: include/posit.h:533
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
one()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
one()Declared at: include/posit.h:540
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
one_minus_ur() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
one_minus_ur() constDescription
1's complement without decoding the posit; only works for 0-bit exponent posits in the unary interval
Declared at: include/posit.h:661
Returns
Posit
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
onehalf()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
onehalf()Declared at: include/posit.h:543
¶constexpr bool operator bool() const
constexpr bool operator bool() constDeclared at: include/posit.h:590
¶constexpr std::complex<float> operator complex()
const
constexpr std::complex<float> operator complex()
constDeclared at: include/posit.h:591
¶constexpr std::complex<float> operator complex()
const
constexpr std::complex<float> operator complex()
constDeclared at: include/posit.h:591
¶constexpr double operator double() const
constexpr double operator double() constDeclared at: include/posit.h:577
¶constexpr float operator float() const
constexpr float operator float() constDeclared at: include/posit.h:576
¶constexpr int operator int() const
constexpr int operator int() constDeclared at: include/posit.h:580
¶constexpr long operator long() const
constexpr long operator long() constDeclared at: include/posit.h:581
¶constexpr long long operator long long() const
constexpr long long operator long long() constDeclared at: include/posit.h:582
¶constexpr short operator short() const
constexpr short operator short() constDeclared at: include/posit.h:579
¶constexpr signed char operator signed char() const
constexpr signed char operator signed char() constDeclared at: include/posit.h:594
¶constexpr posit::Posit::BackendT
operator typename conditional<
is_posit_backend<FT>::value,
type - parameter - 0 - 3,
typename conditional<
std::is_floating_point<FT>::value,
BackendFloat<type - parameter - 0 - 3>,
Unpacked<type - parameter - 0 - 3,
typename PositTrait<
type - parameter - 0 - 0,
totalbits,
esbits,
positspec>::exponenttype> >::
type>::type() const
constexpr posit::Posit::BackendT
operator typename conditional<
is_posit_backend<FT>::value,
type - parameter - 0 - 3,
typename conditional<
std::is_floating_point<FT>::value,
BackendFloat<type - parameter - 0 - 3>,
Unpacked<type - parameter - 0 - 3,
typename PositTrait<
type - parameter - 0 - 0,
totalbits,
esbits,
positspec>::exponenttype> >::
type>::type() constDeclared at: include/posit.h:573
¶constexpr unsigned char operator unsigned char()
const
constexpr unsigned char operator unsigned char()
constDeclared at: include/posit.h:593
¶constexpr unsigned int operator unsigned int()
const
constexpr unsigned int operator unsigned int()
constDeclared at: include/posit.h:585
¶constexpr unsigned long operator unsigned long()
const
constexpr unsigned long operator unsigned long()
constDeclared at: include/posit.h:586
¶constexpr unsigned long long
operator unsigned long long() const
constexpr unsigned long long
operator unsigned long long() constDeclared at: include/posit.h:587
¶constexpr unsigned short operator unsigned short()
const
constexpr unsigned short operator unsigned short()
constDeclared at: include/posit.h:584
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pack_low(posit::Posit::UnpackedPosit)
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pack_low(posit::Posit::UnpackedPosit)Description
transform from unpacled low (Level 2) to bit representation (Level 1)
Declared at: include/posit.h:235
Parameters
- posit::Posit::UnpackedPosit
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pinf()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pinf()Declared at: include/posit.h:532
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
prev() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
prev() constDescription
Returns previous (clockwise in the Posit ring) regular Posit number
Declared at: include/posit.h:429
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudosigmoid() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudosigmoid() constDescription
Pseudosigmoid without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:616
Returns
Posit
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudosigmoidalt() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudosigmoidalt() constDescription
Alternative Pseudosigmoid without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:624
Returns
Posit
¶Posit<T, totalbits, esbits, FT, positspec>
pseudosoftplus() const
Posit<T, totalbits, esbits, FT, positspec>
pseudosoftplus() constDescription
Pseudo-SoftPlus without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:636
Returns
Posit
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudotanh(int k) const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudotanh(int k) constDescription
Pseudo-generalized TANH without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:640
Parameters
- int k
Returns
Posit
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudotanh() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
pseudotanh() constDescription
Pseudo-Hyperbolic Tangent without decoding the Posit; only works for 0-bit exponent posits
Declared at: include/posit.h:644
Returns
Posit
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
reciprocate() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
reciprocate() constDescription
Returns 1/x as Level 1. Special Cases: zero should give positive infinity, if present, nan otherwise; nan should be nan, if present; +inf/-inf should give zero, if present; before0,after0 should give infinity, if present.
Declared at: include/posit.h:524
Returns
constexpr Posit
¶constexpr posit::Posit::BackendT to_backend()
const
constexpr posit::Posit::BackendT to_backend()
constDescription
Unpack the Posit to its backend type BackendT
Declared at: include/posit.h:401
Returns
An instance of the BackendT initialized with the current posit value
¶template <class PT2>
PT2 to_posit()
template <class PT2>
PT2 to_posit()Description
Convert the posit to another posit described by PT2
Declared at: include/posit.h:249
Templates
- PT2
- is a posit type declaration (e.g. posit::Posit <int8 _t, 8 , 0, uint_fast32_t, posit::PositSpec::WithNan>)
¶template <class QuireT>
QuireT to_quire()
template <class QuireT>
QuireT to_quire()Description
Convert the posit to a backend fixed point for quire-like accumulation
Declared at: include/posit.h:267
Templates
- QuireT
- is the quire type (e.g. uint64_t)
¶constexpr T to_sraw() const
constexpr T to_sraw() constDescription
Returns Posit integer representation
Declared at: include/posit.h:393
Returns
Posit integer field v
¶constexpr typename PT::POSIT_UTYPE to_uraw() const
constexpr typename PT::POSIT_UTYPE to_uraw() constDescription
Returns Posit unsigned integer representation
Declared at: include/posit.h:397
Returns
Posit integer field v as unsigned type
¶constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
twice() const
constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
twice() constDescription
returns half (Level 1)
Declared at: include/posit.h:229
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
two()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
two()Declared at: include/posit.h:541
¶constexpr posit::Posit::UnpackedPosit unpack_low()
const
constexpr posit::Posit::UnpackedPosit unpack_low()
constDescription
transform from bit representation (Level 1) to unpacked low (Level 2)
Declared at: include/posit.h:232
¶static constexpr posit::Posit::UnpackedPosit
unpacked_full2low(posit::Posit::BackendT x)
static constexpr posit::Posit::UnpackedPosit
unpacked_full2low(posit::Posit::BackendT x)Description
transform from Level 2 to Level 4
Declared at: include/posit.h:241
Parameters
- posit::Posit::BackendT x
¶static constexpr posit::Posit::BackendT
unpacked_low2full(posit::Posit::UnpackedPosit x)
static constexpr posit::Posit::BackendT
unpacked_low2full(posit::Posit::UnpackedPosit x)Description
transform from Level 2 to Level 4
Declared at: include/posit.h:238
Parameters
- posit::Posit::UnpackedPosit x
¶static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
zero()
static constexpr Posit<T,
totalbits,
esbits,
FT,
positspec>
zero()Declared at: include/posit.h:530