#include <tlfloat/tlfloat.hpp>
Public Member Functions | |
constexpr TLFLOAT_INLINE | TLFloat ()=default |
constexpr TLFLOAT_INLINE | TLFloat (const TLFloat &)=default |
constexpr TLFLOAT_INLINE TLFloat & | operator= (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 TLFloat & | operator= (const srctype &s) |
template<typename rhstype > | |
constexpr TLFLOAT_INLINE TLFloat & | operator+= (const rhstype &rhs) |
template<typename rhstype > | |
constexpr TLFLOAT_INLINE TLFloat & | operator-= (const rhstype &rhs) |
template<typename rhstype > | |
constexpr TLFLOAT_INLINE TLFloat & | operator*= (const rhstype &rhs) |
template<typename rhstype > | |
constexpr TLFloat & | operator/= (const rhstype &rhs) |
constexpr TLFLOAT_INLINE TLFloat & | operator++ () |
constexpr TLFLOAT_INLINE TLFloat & | operator-- () |
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) |
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.
|
constexprdefault |
|
constexprdefault |
|
inlineconstexpr |
|
inlineconstexpr |
Cast from an instance of any TLFloat class
|
inlineconstexpr |
Cast from any primitive integer type
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Any non-integer object is bitcast to a TLFloat type of the same size with this constructor
|
inlineconstexpr |
This works like strtod
|
inlinestaticconstexpr |
Returns 10^a
|
inlinestaticconstexpr |
Returns the absolute value difference between 1.0 and the next representable value
|
inlinestaticconstexpr |
Returns the maximum representative number of the given sign
|
inlinestaticconstexpr |
Returns the minimum normalized number of the given sign
|
inlinestaticconstexpr |
Returns the minimum representative number of the given sign
|
inlineconstexpr |
|
inlinestaticconstexpr |
Returns infinity of the given sign
|
inlinestaticconstexpr |
Returns NaN
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineexplicitconstexpr |
|
inlineexplicitconstexpr |
|
inlineexplicitconstexpr |
|
inlineconstexpr |
Cast to any primitive integer type
|
inlineexplicitconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
This function performs ordered comparison of two floating point numbers.
|
inlineconstexpr |
|
inlineconstexpr |
This function performs multiplication of two floating point numbers. This function returns correctly rounded results.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
This function performs addition of two floating point numbers. This function returns correctly rounded results.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
This function performs subtraction of floating point numbers. This function returns correctly rounded results.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
This function performs division of floating point numbers. This function returns correctly rounded results.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
This function performs ordered comparison of two floating point numbers.
|
inlineconstexpr |
|
inlineconstexpr |
This function performs ordered comparison of two floating point numbers.
|
inlineconstexpr |
|
constexprdefault |
|
inlineconstexpr |
|
inlineconstexpr |
This function performs ordered comparison of two floating point numbers.
|
inlineconstexpr |
|
inlineconstexpr |
This function performs ordered comparison of two floating point numbers.
|
inlineconstexpr |
|
inlineconstexpr |
This function performs ordered comparison of two floating point numbers.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Returns zero of the given sign
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h.
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function performs the fused multiply-add operation of floating point numbers. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h.
|
friend |
|
friend |
This function has the same functionality as the corresponding function in math.h.
|
friend |
This function has the same functionality as the corresponding function in math.h. The accuracy of the return value is 1ULP.
|
friend |
This function has the same functionality as the corresponding function in math.h.
|
friend |
|
friend |
This function has the same functionality as the corresponding function in math.h.
|
friend |
|
friend |
This function has the same functionality as the corresponding function in math.h.
|
friend |
|
friend |
This function has the same functionality as the corresponding function in math.h.
|
friend |
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
|
friend |
This function has the same functionality as the corresponding function in math.h.
This function finds the square root of a floating point number. This function returns correctly rounded results.
This function has the same functionality as the corresponding function in math.h. This function returns correctly rounded results.
mant_t tlfloat::TLFloat< Unpacked_t >::m = 0 |