TLFloat 1.15.0
tlfloat::TLFloat< Unpacked_t > Class Template Reference

#include <tlfloat/tlfloat.hpp>

Public Member Functions

constexpr TLFLOAT_INLINE TLFloat ()=default
constexpr TLFLOAT_INLINE TLFloat (const TLFloat &)=default
constexpr TLFLOAT_INLINE TLFloatoperator= (const TLFloat &)=default
constexpr TLFLOAT_INLINE Unpacked_t getUnpacked () const
template<typename mant_t_, typename longmant_t_, int nbexp_, int nbmant_>
constexpr TLFLOAT_INLINE TLFloat (const detail::UnpackedFloat< mant_t_, longmant_t_, nbexp_, nbmant_ > &tf)
template<typename srctftype>
constexpr TLFLOAT_INLINE TLFloat (const TLFloat< srctftype > &s)
template<typename inttype, std::enable_if_t<(std::is_integral_v< inttype >), int > = 0>
constexpr TLFLOAT_INLINE TLFloat (const inttype x)
template<typename inttype, std::enable_if_t<(std::is_integral_v< inttype >), int > = 0>
constexpr TLFLOAT_INLINE operator inttype () const
template<int N>
constexpr TLFLOAT_INLINE TLFloat (const BigInt< N > x)
template<int N>
constexpr TLFLOAT_INLINE TLFloat (const BigUInt< N > x)
template<int N>
constexpr TLFLOAT_INLINE operator BigInt< N > () const
template<int N>
constexpr TLFLOAT_INLINE operator BigUInt< N > () const
constexpr TLFloat (const double d)
constexpr TLFloat (const float f)
template<typename fptype, std::enable_if_t<(sizeof(fptype)==sizeof(mant_t) &&std::is_trivially_copyable_v< fptype > &&(std::is_floating_point_v< fptype >||(!std::is_pointer_v< fptype > &&!std::is_integral_v< fptype >))), int > = 0>
constexpr TLFLOAT_INLINE TLFloat (const fptype &s)
template<typename fptype, std::enable_if_t<(sizeof(fptype)==sizeof(mant_t) &&std::is_trivially_copyable_v< fptype > &&(std::is_floating_point_v< fptype >||(!std::is_pointer_v< fptype > &&!std::is_integral_v< fptype >))), int > = 0>
constexpr TLFLOAT_INLINE operator fptype () const
constexpr TLFloat (const char *ptr, const char **endptr=nullptr)
constexpr TLFLOAT_INLINE operator Unpacked_t () const
constexpr operator double () const
constexpr operator float () const
constexpr TLFLOAT_INLINE TLFloat operator- () const
constexpr TLFLOAT_INLINE TLFloat operator+ () const
constexpr TLFloat operator+ (const TLFloat &rhs) const
constexpr TLFloat operator- (const TLFloat &rhs) const
constexpr TLFloat operator* (const TLFloat &rhs) const
constexpr TLFloat operator/ (const TLFloat &rhs) const
constexpr TLFLOAT_INLINE bool operator== (const TLFloat &rhs) const
constexpr TLFLOAT_INLINE bool operator!= (const TLFloat &rhs) const
constexpr TLFLOAT_INLINE bool operator> (const TLFloat &rhs) const
constexpr TLFLOAT_INLINE bool operator< (const TLFloat &rhs) const
constexpr TLFLOAT_INLINE bool operator>= (const TLFloat &rhs) const
constexpr TLFLOAT_INLINE bool operator<= (const TLFloat &rhs) const
template<typename srctype>
constexpr TLFLOAT_INLINE TLFloatoperator= (const srctype &s)
template<typename rhstype>
constexpr TLFLOAT_INLINE TLFloatoperator+= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE TLFloatoperator-= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE TLFloatoperator*= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFloatoperator/= (const rhstype &rhs)
constexpr TLFLOAT_INLINE TLFloatoperator++ ()
constexpr TLFLOAT_INLINE TLFloatoperator-- ()
constexpr TLFLOAT_INLINE TLFloat operator++ (int)
constexpr TLFLOAT_INLINE TLFloat operator-- (int)
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE TLFloat operator+ (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE TLFloat operator- (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE TLFloat operator* (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFloat operator/ (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator== (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator!= (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator> (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator< (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator>= (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator<= (const rhstype &rhs) const

Static Public Member Functions

static constexpr TLFLOAT_INLINE TLFloat nan ()
static constexpr TLFLOAT_INLINE TLFloat infinity (bool sign=false)
static constexpr TLFLOAT_INLINE TLFloat flt_true_min (bool sign=false)
static constexpr TLFLOAT_INLINE TLFloat flt_min (bool sign=false)
static constexpr TLFLOAT_INLINE TLFloat flt_max (bool sign=false)
static constexpr TLFLOAT_INLINE TLFloat flt_epsilon ()
static constexpr TLFLOAT_INLINE TLFloat zero (bool sign=false)
static constexpr TLFLOAT_INLINE Unpacked_t to_Unpacked_t (TLFloat f=zero())
static constexpr TLFloat exp10i (int a)

Public Attributes

mant_t m = 0

Friends

template<typename>
class TLFloat
constexpr TLFloat fabs (const TLFloat &u)
constexpr TLFloat copysign (const TLFloat &x, const TLFloat &y)
constexpr TLFloat fmax (const TLFloat &x, const TLFloat &y)
constexpr TLFloat fmin (const TLFloat &x, const TLFloat &y)
constexpr TLFloat fdim (const TLFloat &x, const TLFloat &y)
constexpr bool isnan (const TLFloat &u)
constexpr bool isinf (const TLFloat &u)
constexpr bool finite (const TLFloat &u)
constexpr int fpclassify (const TLFloat &u)
constexpr TLFLOAT_INLINE bool signbit (const TLFloat &u)
constexpr TLFLOAT_INLINE bool iszero (const TLFloat &u)
constexpr TLFLOAT_INLINE bool isint (const TLFloat &u)
constexpr TLFLOAT_INLINE bool iseven (const TLFloat &u)
constexpr TLFloat fma (const TLFloat &x, const TLFloat &y, const TLFloat &z)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE TLFloat operator+ (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE TLFloat operator- (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE TLFloat operator* (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFloat operator/ (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator== (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator!= (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator> (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator< (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator>= (const lhstype &lhs, const TLFloat &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
constexpr TLFLOAT_INLINE bool operator<= (const lhstype &lhs, const TLFloat &rhs)
constexpr int32_t ilogb (const TLFloat &f)
constexpr xpair< TLFloat, int > frexp (const TLFloat &f)
constexpr TLFloat frexp (const TLFloat &f, int *exp)
constexpr TLFloat ldexp (const TLFloat &f, int exp)
constexpr TLFloat sqrt (const TLFloat &d)
constexpr TLFloat hypot (const TLFloat &x, const TLFloat &y)
constexpr TLFloat trunc (const TLFloat &d)
constexpr TLFloat floor (const TLFloat &d)
constexpr TLFloat ceil (const TLFloat &d)
constexpr TLFloat round (const TLFloat &d)
constexpr TLFloat rint (const TLFloat &d)
constexpr TLFloat modf (const TLFloat &x, TLFloat *iptr)
constexpr TLFloat nextafter (const TLFloat &x, const TLFloat &y)

Detailed Description

template<typename Unpacked_t>
class tlfloat::TLFloat< Unpacked_t >

This is a trivially copyable generic template class that represents an IEEE 754 floating-point number. By adjusting the template parameters, it can represent an IEEE 754 floating-point number of any precision. The data size and data structure of the object are the same as the corresponding floating-point number represented in the IEEE 754 format.

Constructor & Destructor Documentation

◆ TLFloat() [1/11]

template<typename Unpacked_t>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( )
constexprdefault

◆ TLFloat() [2/11]

template<typename Unpacked_t>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( const TLFloat< Unpacked_t > & )
constexprdefault

◆ TLFloat() [3/11]

template<typename Unpacked_t>
template<typename mant_t_, typename longmant_t_, int nbexp_, int nbmant_>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( const detail::UnpackedFloat< mant_t_, longmant_t_, nbexp_, nbmant_ > & tf)
inlineconstexpr

◆ TLFloat() [4/11]

template<typename Unpacked_t>
template<typename srctftype>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( const TLFloat< srctftype > & s)
inlineconstexpr

Cast from an instance of any TLFloat class

◆ TLFloat() [5/11]

template<typename Unpacked_t>
template<typename inttype, std::enable_if_t<(std::is_integral_v< inttype >), int > = 0>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( const inttype x)
inlineconstexpr

Cast from any primitive integer type

◆ TLFloat() [6/11]

template<typename Unpacked_t>
template<int N>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( const BigInt< N > x)
inlineconstexpr

◆ TLFloat() [7/11]

template<typename Unpacked_t>
template<int N>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( const BigUInt< N > x)
inlineconstexpr

◆ TLFloat() [8/11]

template<typename Unpacked_t>
tlfloat::TLFloat< Unpacked_t >::TLFloat ( const double d)
inlineconstexpr

◆ TLFloat() [9/11]

template<typename Unpacked_t>
tlfloat::TLFloat< Unpacked_t >::TLFloat ( const float f)
inlineconstexpr

◆ TLFloat() [10/11]

template<typename Unpacked_t>
template<typename fptype, std::enable_if_t<(sizeof(fptype)==sizeof(mant_t) &&std::is_trivially_copyable_v< fptype > &&(std::is_floating_point_v< fptype >||(!std::is_pointer_v< fptype > &&!std::is_integral_v< fptype >))), int > = 0>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::TLFloat ( const fptype & s)
inlineconstexpr

Any non-integer object is bitcast to a TLFloat type of the same size with this constructor

◆ TLFloat() [11/11]

template<typename Unpacked_t>
tlfloat::TLFloat< Unpacked_t >::TLFloat ( const char * ptr,
const char ** endptr = nullptr )
inlineconstexpr

This works like strtod

Member Function Documentation

◆ exp10i()

template<typename Unpacked_t>
constexpr TLFloat tlfloat::TLFloat< Unpacked_t >::exp10i ( int a)
inlinestaticconstexpr

Returns 10^a

◆ flt_epsilon()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::flt_epsilon ( )
inlinestaticconstexpr

Returns the absolute value difference between 1.0 and the next representable value

◆ flt_max()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::flt_max ( bool sign = false)
inlinestaticconstexpr

Returns the maximum representative number of the given sign

◆ flt_min()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::flt_min ( bool sign = false)
inlinestaticconstexpr

Returns the minimum normalized number of the given sign

◆ flt_true_min()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::flt_true_min ( bool sign = false)
inlinestaticconstexpr

Returns the minimum representative number of the given sign

◆ getUnpacked()

template<typename Unpacked_t>
TLFLOAT_INLINE Unpacked_t tlfloat::TLFloat< Unpacked_t >::getUnpacked ( ) const
inlineconstexpr

◆ infinity()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::infinity ( bool sign = false)
inlinestaticconstexpr

Returns infinity of the given sign

◆ nan()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::nan ( )
inlinestaticconstexpr

Returns NaN

◆ operator BigInt< N >()

template<typename Unpacked_t>
template<int N>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::operator BigInt< N > ( ) const
inlineconstexpr

◆ operator BigUInt< N >()

template<typename Unpacked_t>
template<int N>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::operator BigUInt< N > ( ) const
inlineconstexpr

◆ operator double()

template<typename Unpacked_t>
tlfloat::TLFloat< Unpacked_t >::operator double ( ) const
inlineexplicitconstexpr

◆ operator float()

template<typename Unpacked_t>
tlfloat::TLFloat< Unpacked_t >::operator float ( ) const
inlineexplicitconstexpr

◆ operator fptype()

template<typename Unpacked_t>
template<typename fptype, std::enable_if_t<(sizeof(fptype)==sizeof(mant_t) &&std::is_trivially_copyable_v< fptype > &&(std::is_floating_point_v< fptype >||(!std::is_pointer_v< fptype > &&!std::is_integral_v< fptype >))), int > = 0>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::operator fptype ( ) const
inlineexplicitconstexpr

◆ operator inttype()

template<typename Unpacked_t>
template<typename inttype, std::enable_if_t<(std::is_integral_v< inttype >), int > = 0>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::operator inttype ( ) const
inlineconstexpr

Cast to any primitive integer type

◆ operator Unpacked_t()

template<typename Unpacked_t>
TLFLOAT_INLINE tlfloat::TLFloat< Unpacked_t >::operator Unpacked_t ( ) const
inlineexplicitconstexpr

◆ operator!=() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator!= ( const rhstype & rhs) const
inlineconstexpr

◆ operator!=() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator!= ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs ordered comparison of two floating point numbers.

◆ operator*() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::operator* ( const rhstype & rhs) const
inlineconstexpr

◆ operator*() [2/2]

template<typename Unpacked_t>
TLFloat tlfloat::TLFloat< Unpacked_t >::operator* ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs multiplication of two floating point numbers. This function returns correctly rounded results.

◆ operator*=()

template<typename Unpacked_t>
template<typename rhstype>
TLFLOAT_INLINE TLFloat & tlfloat::TLFloat< Unpacked_t >::operator*= ( const rhstype & rhs)
inlineconstexpr

◆ operator+() [1/3]

template<typename Unpacked_t>
TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::operator+ ( ) const
inlineconstexpr

◆ operator+() [2/3]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::operator+ ( const rhstype & rhs) const
inlineconstexpr

◆ operator+() [3/3]

template<typename Unpacked_t>
TLFloat tlfloat::TLFloat< Unpacked_t >::operator+ ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs addition of two floating point numbers. This function returns correctly rounded results.

◆ operator++() [1/2]

template<typename Unpacked_t>
TLFLOAT_INLINE TLFloat & tlfloat::TLFloat< Unpacked_t >::operator++ ( )
inlineconstexpr

◆ operator++() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::operator++ ( int )
inlineconstexpr

◆ operator+=()

template<typename Unpacked_t>
template<typename rhstype>
TLFLOAT_INLINE TLFloat & tlfloat::TLFloat< Unpacked_t >::operator+= ( const rhstype & rhs)
inlineconstexpr

◆ operator-() [1/3]

template<typename Unpacked_t>
TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::operator- ( ) const
inlineconstexpr

◆ operator-() [2/3]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::operator- ( const rhstype & rhs) const
inlineconstexpr

◆ operator-() [3/3]

template<typename Unpacked_t>
TLFloat tlfloat::TLFloat< Unpacked_t >::operator- ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs subtraction of floating point numbers. This function returns correctly rounded results.

◆ operator--() [1/2]

template<typename Unpacked_t>
TLFLOAT_INLINE TLFloat & tlfloat::TLFloat< Unpacked_t >::operator-- ( )
inlineconstexpr

◆ operator--() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::operator-- ( int )
inlineconstexpr

◆ operator-=()

template<typename Unpacked_t>
template<typename rhstype>
TLFLOAT_INLINE TLFloat & tlfloat::TLFloat< Unpacked_t >::operator-= ( const rhstype & rhs)
inlineconstexpr

◆ operator/() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFloat tlfloat::TLFloat< Unpacked_t >::operator/ ( const rhstype & rhs) const
inlineconstexpr

◆ operator/() [2/2]

template<typename Unpacked_t>
TLFloat tlfloat::TLFloat< Unpacked_t >::operator/ ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs division of floating point numbers. This function returns correctly rounded results.

◆ operator/=()

template<typename Unpacked_t>
template<typename rhstype>
TLFloat & tlfloat::TLFloat< Unpacked_t >::operator/= ( const rhstype & rhs)
inlineconstexpr

◆ operator<() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator< ( const rhstype & rhs) const
inlineconstexpr

◆ operator<() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator< ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs ordered comparison of two floating point numbers.

◆ operator<=() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator<= ( const rhstype & rhs) const
inlineconstexpr

◆ operator<=() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator<= ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs ordered comparison of two floating point numbers.

◆ operator=() [1/2]

template<typename Unpacked_t>
template<typename srctype>
TLFLOAT_INLINE TLFloat & tlfloat::TLFloat< Unpacked_t >::operator= ( const srctype & s)
inlineconstexpr

◆ operator=() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE TLFloat & tlfloat::TLFloat< Unpacked_t >::operator= ( const TLFloat< Unpacked_t > & )
constexprdefault

◆ operator==() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator== ( const rhstype & rhs) const
inlineconstexpr

◆ operator==() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator== ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs ordered comparison of two floating point numbers.

◆ operator>() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator> ( const rhstype & rhs) const
inlineconstexpr

◆ operator>() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator> ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs ordered comparison of two floating point numbers.

◆ operator>=() [1/2]

template<typename Unpacked_t>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||sizeof(rhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator>= ( const rhstype & rhs) const
inlineconstexpr

◆ operator>=() [2/2]

template<typename Unpacked_t>
TLFLOAT_INLINE bool tlfloat::TLFloat< Unpacked_t >::operator>= ( const TLFloat< Unpacked_t > & rhs) const
inlineconstexpr

This function performs ordered comparison of two floating point numbers.

◆ to_Unpacked_t()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE Unpacked_t tlfloat::TLFloat< Unpacked_t >::to_Unpacked_t ( TLFloat< Unpacked_t > f = zero())
inlinestaticconstexpr

◆ zero()

template<typename Unpacked_t>
constexpr TLFLOAT_INLINE TLFloat tlfloat::TLFloat< Unpacked_t >::zero ( bool sign = false)
inlinestaticconstexpr

Returns zero of the given sign

◆ ceil

template<typename Unpacked_t>
TLFloat ceil ( const TLFloat< Unpacked_t > & d)
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ copysign

template<typename Unpacked_t>
TLFloat copysign ( const TLFloat< Unpacked_t > & x,
const TLFloat< Unpacked_t > & y )
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ fabs

template<typename Unpacked_t>
TLFloat fabs ( const TLFloat< Unpacked_t > & u)
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ fdim

template<typename Unpacked_t>
TLFloat fdim ( const TLFloat< Unpacked_t > & x,
const TLFloat< Unpacked_t > & y )
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ finite

template<typename Unpacked_t>
bool finite ( const TLFloat< Unpacked_t > & u)
friend

This function has the same functionality as the corresponding function in math.h.

◆ floor

template<typename Unpacked_t>
TLFloat floor ( const TLFloat< Unpacked_t > & d)
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ fma

template<typename Unpacked_t>
TLFloat fma ( const TLFloat< Unpacked_t > & x,
const TLFloat< Unpacked_t > & y,
const TLFloat< Unpacked_t > & z )
friend

This function performs the fused multiply-add operation of floating point numbers. This function returns correctly rounded results.

◆ fmax

template<typename Unpacked_t>
TLFloat fmax ( const TLFloat< Unpacked_t > & x,
const TLFloat< Unpacked_t > & y )
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ fmin

template<typename Unpacked_t>
TLFloat fmin ( const TLFloat< Unpacked_t > & x,
const TLFloat< Unpacked_t > & y )
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ fpclassify

template<typename Unpacked_t>
int fpclassify ( const TLFloat< Unpacked_t > & u)
friend

This function has the same functionality as the corresponding function in math.h.

◆ frexp [1/2]

template<typename Unpacked_t>
xpair< TLFloat, int > frexp ( const TLFloat< Unpacked_t > & f)
friend

◆ frexp [2/2]

template<typename Unpacked_t>
TLFloat frexp ( const TLFloat< Unpacked_t > & f,
int * exp )
friend

This function has the same functionality as the corresponding function in math.h.

◆ hypot

template<typename Unpacked_t>
TLFloat hypot ( const TLFloat< Unpacked_t > & x,
const TLFloat< Unpacked_t > & y )
friend

This function has the same functionality as the corresponding function in math.h. The accuracy of the return value is 1ULP.

◆ ilogb

template<typename Unpacked_t>
int32_t ilogb ( const TLFloat< Unpacked_t > & f)
friend

This function has the same functionality as the corresponding function in math.h.

◆ iseven

template<typename Unpacked_t>
TLFLOAT_INLINE bool iseven ( const TLFloat< Unpacked_t > & u)
friend

◆ isinf

template<typename Unpacked_t>
bool isinf ( const TLFloat< Unpacked_t > & u)
friend

This function has the same functionality as the corresponding function in math.h.

◆ isint

template<typename Unpacked_t>
TLFLOAT_INLINE bool isint ( const TLFloat< Unpacked_t > & u)
friend

◆ isnan

template<typename Unpacked_t>
bool isnan ( const TLFloat< Unpacked_t > & u)
friend

This function has the same functionality as the corresponding function in math.h.

◆ iszero

template<typename Unpacked_t>
TLFLOAT_INLINE bool iszero ( const TLFloat< Unpacked_t > & u)
friend

◆ ldexp

template<typename Unpacked_t>
TLFloat ldexp ( const TLFloat< Unpacked_t > & f,
int exp )
friend

This function has the same functionality as the corresponding function in math.h.

◆ modf

template<typename Unpacked_t>
TLFloat modf ( const TLFloat< Unpacked_t > & x,
TLFloat< Unpacked_t > * iptr )
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ nextafter

template<typename Unpacked_t>
TLFloat nextafter ( const TLFloat< Unpacked_t > & x,
const TLFloat< Unpacked_t > & y )
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ operator!=

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool operator!= ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator*

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE TLFloat operator* ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator+

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE TLFloat operator+ ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator-

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE TLFloat operator- ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator/

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFloat operator/ ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator<

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool operator< ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator<=

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool operator<= ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator==

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool operator== ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator>

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool operator> ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ operator>=

template<typename Unpacked_t>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||sizeof(lhstype)<=sizeof(mant_t)), int > = 0>
TLFLOAT_INLINE bool operator>= ( const lhstype & lhs,
const TLFloat< Unpacked_t > & rhs )
friend

◆ rint

template<typename Unpacked_t>
TLFloat rint ( const TLFloat< Unpacked_t > & d)
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ round

template<typename Unpacked_t>
TLFloat round ( const TLFloat< Unpacked_t > & d)
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

◆ signbit

template<typename Unpacked_t>
TLFLOAT_INLINE bool signbit ( const TLFloat< Unpacked_t > & u)
friend

This function has the same functionality as the corresponding function in math.h.

◆ sqrt

template<typename Unpacked_t>
TLFloat sqrt ( const TLFloat< Unpacked_t > & d)
friend

This function finds the square root of a floating point number. This function returns correctly rounded results.

◆ TLFloat

template<typename Unpacked_t>
template<typename>
friend class TLFloat
friend

◆ trunc

template<typename Unpacked_t>
TLFloat trunc ( const TLFloat< Unpacked_t > & d)
friend

This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.

Member Data Documentation

◆ m

template<typename Unpacked_t>
mant_t tlfloat::TLFloat< Unpacked_t >::m = 0

The documentation for this class was generated from the following files: