tlfloat::BigUInt< N > Class Template Reference

`#include <tlfloat/bigint.hpp>`

## Classes

class | Montgomery

## Public Member Functions

constexpr TLFLOAT_INLINE | BigUInt (const BigUInt< N-1 > &h, const BigUInt< N-1 > &l)
constexpr TLFLOAT_INLINE | BigUInt ()=default
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&std::is_unsigned_v< T > &&sizeof(T)<=8), int > = 0>
constexpr TLFLOAT_INLINE | BigUInt (T u)
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&!std::is_unsigned_v< T > &&sizeof(T)<=8), int > = 0>
constexpr TLFLOAT_INLINE | BigUInt (T i)
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&std::is_unsigned_v< T > &&sizeof(T)<=8 &&!std::is_same_v< T, bool >), int > = 0>
constexpr TLFLOAT_INLINE | operator T () const
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&!std::is_unsigned_v< T > &&sizeof(T)<=8 &&!std::is_same_v< T, bool >), int > = 0>
constexpr TLFLOAT_INLINE | operator T () const
constexpr TLFLOAT_INLINE | operator bool () const
constexpr TLFLOAT_INLINE | BigUInt (const BigUInt &m)=default
constexpr TLFLOAT_INLINE | BigUInt (const BigUInt< N+1 > &h)
template<int K, std::enable_if_t<(K< N)> * = nullptr>
constexpr TLFLOAT_INLINE | BigUInt (const BigUInt< K > &l)
template<int K, std::enable_if_t<(K >(N+1))> * = nullptr>
constexpr TLFLOAT_INLINE | BigUInt (const BigUInt< K > &h)
constexpr TLFLOAT_INLINE BigUInt & | operator= (const BigUInt &u)=default
constexpr TLFLOAT_INLINE | BigUInt (const uint64_t *p)
constexpr | BigUInt (double d)
constexpr | operator double () const
constexpr TLFLOAT_INLINE unsigned | clz () const
constexpr TLFLOAT_INLINE unsigned | ilogbp1 () const
constexpr TLFLOAT_INLINE bool | isZero () const
constexpr TLFLOAT_INLINE bool | isZero2 () const
constexpr TLFLOAT_INLINE bool | isAllOne () const
constexpr TLFLOAT_INLINE bool | msb () const
constexpr TLFLOAT_INLINE uint64_t | getWord (unsigned idx) const
constexpr TLFLOAT_INLINE void | setWord (unsigned idx, uint64_t u)
constexpr TLFLOAT_INLINE bool | bit (unsigned idx) const
constexpr TLFLOAT_INLINE BigUInt & | operator++ ()
constexpr TLFLOAT_INLINE BigUInt & | operator-- ()
constexpr TLFLOAT_INLINE BigUInt | operator++ (int)
constexpr TLFLOAT_INLINE BigUInt | operator-- (int)
template<int..., int K = N, std::enable_if_t<(K !=7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator+ (const BigUInt &rhs) const
template<int..., int K = N, std::enable_if_t<(K !=7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator- (const BigUInt &rhs) const
template<int..., int K = N, std::enable_if_t<(K==7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator+ (const BigUInt &rhs) const
| defined(TLFLOAT_ENABLE_INT128_OPT)
template<int..., int K = N, std::enable_if_t<(K==7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator- (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator+ (const BigUInt< N-1 > &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator- (const BigUInt< N-1 > &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator- () const
constexpr TLFLOAT_INLINE BigUInt | operator+ () const
constexpr TLFLOAT_INLINE BigUInt | operator* (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator* (const BigUInt< N-1 > &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator/ (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator% (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | reciprocal () const
constexpr TLFLOAT_INLINE BigUInt | reciprocal2 () const
constexpr TLFLOAT_INLINE bool | eq (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE bool | operator== (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE bool | operator!= (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE int | compare (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE bool | operator> (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE bool | operator< (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE bool | operator<= (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE bool | operator>= (BigUInt const &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator& (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator| (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator^ (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | operator~ () const
constexpr TLFLOAT_INLINE BigUInt | operator<< (int n) const
constexpr TLFLOAT_INLINE BigUInt | operator>> (int n) const
constexpr TLFLOAT_INLINE BigUInt & | operator<<= (int n)
constexpr TLFLOAT_INLINE BigUInt & | operator>>= (int n)
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator+ (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator- (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator* (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator/ (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator% (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator& (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator| (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE BigUInt | operator^ (const rhstype &rhs) const
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), 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)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), 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)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), 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)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), 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)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), 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)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>
constexpr TLFLOAT_INLINE bool | operator<= (const rhstype &rhs) const
template<typename srctype>
constexpr TLFLOAT_INLINE BigUInt & | operator= (const srctype &s)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator+= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator-= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator*= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator/= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator%= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator&= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator|= (const rhstype &rhs)
template<typename rhstype>
constexpr TLFLOAT_INLINE BigUInt & | operator^= (const rhstype &rhs)
constexpr TLFLOAT_INLINE BigUInt & | operator+= (bool rhs)
constexpr TLFLOAT_INLINE BigUInt | divmod (const BigUInt &rhs, const BigUInt &recip, BigUInt *mod) const
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > | divmod (const BigUInt &rhs, const BigUInt &recip) const
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > | divmod (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > | divmod2 (const BigUInt &rhs, const BigUInt &recip2) const
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > | divmod2 (const BigUInt &rhs) const
constexpr TLFLOAT_INLINE BigUInt | mod (const BigUInt &rhs, const BigUInt &recip) const
constexpr BigUInt | pow (BigUInt e, const BigUInt &m=0, BigUInt recm=0) const
constexpr BigUInt | gcd (BigUInt b) const
constexpr TLFLOAT_NOINLINE | BigUInt (const char *p_, const char **endptr=nullptr, const int base_=10)

## Public Attributes

BigUInt< N-1 > | low = 0
BigUInt< N-1 > | high = 0

## Friends

template<int>
class | BigUInt
template<int>
class | BigInt
template<typename Unpacked_t>
class | TLFloat
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator+ (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator- (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator* (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator/ (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator% (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator& (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator| (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend BigUInt | operator^ (const lhstype c, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend bool | operator== (const lhstype &lhs, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend bool | operator!= (const lhstype &lhs, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend bool | operator> (const lhstype &lhs, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend bool | operator< (const lhstype &lhs, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend bool | operator>= (const lhstype &lhs, const BigUInt &rhs)
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>
constexpr TLFLOAT_INLINE friend bool | operator<= (const lhstype &lhs, const BigUInt &rhs)

## Detailed Description

template<int N>
class tlfloat::BigUInt< N >

This is a trivially copyable template class that represents an arbitrary precision unsigned integer. It can represent an unsigned integer less than 2^N. The data size of an object is N bits, where N must be 7 or greater.

## Constructor & Destructor Documentation

## BigUInt() [1/11]

template<int N>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | const BigUInt< N-1 > & | h,
|  | const BigUInt< N-1 > & | l )

inline constexpr

## BigUInt() [2/11]

template<int N>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( |  | ) |

constexpr default

## BigUInt() [3/11]

template<int N>
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&std::is_unsigned_v< T > &&sizeof(T)<=8), int > = 0>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | T | u | ) |

inline constexpr

Cast from any primitive unsigned integer

## BigUInt() [4/11]

template<int N>
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&!std::is_unsigned_v< T > &&sizeof(T)<=8), int > = 0>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | T | i | ) |

inline constexpr

Cast from any primitive signed integer

## BigUInt() [5/11]

template<int N>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | const BigUInt< N > & | m | ) |

constexpr default

## BigUInt() [6/11]

template<int N>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | const BigUInt< N+1 > & | h | ) |

inline explicit constexpr

## BigUInt() [7/11]

template<int N>
template<int K, std::enable_if_t<(K< N)> * = nullptr>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | const BigUInt< K > & | l | ) |

inline constexpr

## BigUInt() [8/11]

template<int N>
template<int K, std::enable_if_t<(K >(N+1))> * = nullptr>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | const BigUInt< K > & | h | ) |

inline explicit constexpr

## BigUInt() [9/11]

template<int N>

TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt | ( | const uint64_t * | p | ) |

inline constexpr

## BigUInt() [10/11]

template<int N>

tlfloat::BigUInt< N >::BigUInt | ( | double | d | ) |

inline explicit constexpr

## BigUInt() [11/11]

template<int N>

TLFLOAT_NOINLINE tlfloat::BigUInt< N >::BigUInt | ( | const char * | p_,
|  | const char ** | endptr = nullptr,
|  | const int | base_ = 10 )

inline constexpr

## Member Function Documentation

## bit()

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::bit | ( | unsigned | idx | ) | const

inline constexpr

## clz()

template<int N>

TLFLOAT_INLINE unsigned tlfloat::BigUInt< N >::clz | ( |  | ) | const

inline constexpr

## compare()

template<int N>

TLFLOAT_INLINE int tlfloat::BigUInt< N >::compare | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## divmod() [1/3]

template<int N>

TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

This method performs division and modulo at a time.

## divmod() [2/3]

template<int N>

TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod | ( | const BigUInt< N > & | rhs,
|  | const BigUInt< N > & | recip ) const

inline constexpr

This method performs division and modulo at a time. Give rhs.reciprocal() as the second argument

## divmod() [3/3]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::divmod | ( | const BigUInt< N > & | rhs,
|  | const BigUInt< N > & | recip,
|  | BigUInt< N > * | mod ) const

inline constexpr

This method performs division and modulo at a time. Give rhs.reciprocal() as the second argument

## divmod2() [1/2]

template<int N>

TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod2 | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

This method finds the quotient and remainder of (*this << ((1 << N)-1)) divided by (rhs | (1 << ((1 << N)-1))) at a time.

## divmod2() [2/2]

template<int N>

TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod2 | ( | const BigUInt< N > & | rhs,
|  | const BigUInt< N > & | recip2 ) const

inline constexpr

This method finds the quotient and remainder of (*this << ((1 << N)-1)) divided by (rhs | (1 << ((1 << N)-1))) at a time. Give rhs.reciprocal2() as the second argument.

## eq()

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::eq | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## gcd()

template<int N>

BigUInt tlfloat::BigUInt< N >::gcd | ( | BigUInt< N > | b | ) | const

inline constexpr

## getWord()

template<int N>

TLFLOAT_INLINE uint64_t tlfloat::BigUInt< N >::getWord | ( | unsigned | idx | ) | const

inline constexpr

## ilogbp1()

template<int N>

TLFLOAT_INLINE unsigned tlfloat::BigUInt< N >::ilogbp1 | ( |  | ) | const

inline constexpr

## isAllOne()

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::isAllOne | ( |  | ) | const

inline constexpr

## isZero()

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::isZero | ( |  | ) | const

inline constexpr

## isZero2()

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::isZero2 | ( |  | ) | const

inline constexpr

## mod()

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::mod | ( | const BigUInt< N > & | rhs,
|  | const BigUInt< N > & | recip ) const

inline constexpr

## msb()

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::msb | ( |  | ) | const

inline constexpr

## operator bool()

template<int N>

TLFLOAT_INLINE tlfloat::BigUInt< N >::operator bool | ( |  | ) | const

inline explicit constexpr

## operator double()

template<int N>

tlfloat::BigUInt< N >::operator double | ( |  | ) | const

inline explicit constexpr

## operator T() [1/2]

template<int N>
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&!std::is_unsigned_v< T > &&sizeof(T)<=8 &&!std::is_same_v< T, bool >), int > = 0>

TLFLOAT_INLINE tlfloat::BigUInt< N >::operator T | ( |  | ) | const

inline explicit constexpr

Cast to any primitive signed integer

## operator T() [2/2]

template<int N>
template<typename T, std::enable_if_t<(std::is_integral_v< T > &&std::is_unsigned_v< T > &&sizeof(T)<=8 &&!std::is_same_v< T, bool >), int > = 0>

TLFLOAT_INLINE tlfloat::BigUInt< N >::operator T | ( |  | ) | const

inline explicit constexpr

Cast to any primitive unsigned integer

## operator!=() [1/2]

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator!= | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## operator!=() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator!= | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator%() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator% | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator%() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator% | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator%=()

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator%= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator&() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator& | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator&() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator& | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator&=()

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator&= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator*() [1/3]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator* | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator*() [2/3]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator* | ( | const BigUInt< N-1 > & | rhs | ) | const

inline constexpr

## operator*() [3/3]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator* | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator*=()

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator*= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator+() [1/5]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ | ( |  | ) | const

inline constexpr

## operator+() [2/5]

template<int N>
template<int..., int K = N, std::enable_if_t<(K==7), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

defined(TLFLOAT_ENABLE_INT128_OPT)

## operator+() [3/5]

template<int N>
template<int..., int K = N, std::enable_if_t<(K !=7), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator+() [4/5]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ | ( | const BigUInt< N-1 > & | rhs | ) | const

inline constexpr

## operator+() [5/5]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator++() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator++ | ( |  | ) |

inline constexpr

## operator++() [2/2]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator++ | ( | int |  | ) |

inline constexpr

## operator+=() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator+= | ( | bool | rhs | ) |

inline constexpr

## operator+=() [2/2]

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator+= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator-() [1/5]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- | ( |  | ) | const

inline constexpr

## operator-() [2/5]

template<int N>
template<int..., int K = N, std::enable_if_t<(K==7), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator-() [3/5]

template<int N>
template<int..., int K = N, std::enable_if_t<(K !=7), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator-() [4/5]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- | ( | const BigUInt< N-1 > & | rhs | ) | const

inline constexpr

## operator-() [5/5]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator--() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator-- | ( |  | ) |

inline constexpr

## operator--() [2/2]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator-- | ( | int |  | ) |

inline constexpr

## operator-=()

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator-= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator/() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator/ | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator/() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator/ | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator/=()

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator/= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator<() [1/2]

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator< | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## operator<() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator< | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator<<()

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator<< | ( | int | n | ) | const

inline constexpr

## operator<<=()

template<int N>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator<<= | ( | int | n | ) |

inline constexpr

## operator<=() [1/2]

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator<= | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## operator<=() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator<= | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator=() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator= | ( | const BigUInt< N > & | u | ) |

constexpr default

## operator=() [2/2]

template<int N>
template<typename srctype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator= | ( | const srctype & | s | ) |

inline constexpr

## operator==() [1/2]

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator== | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## operator==() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator== | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator>() [1/2]

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator> | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## operator>() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator> | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator>=() [1/2]

template<int N>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator>= | ( | BigUInt< N > const & | rhs | ) | const

inline constexpr

## operator>=() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator>= | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator>>()

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator>> | ( | int | n | ) | const

inline constexpr

## operator>>=()

template<int N>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator>>= | ( | int | n | ) |

inline constexpr

## operator^() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator^ | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator^() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator^ | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator^=()

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator^= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator|() [1/2]

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator| | ( | const BigUInt< N > & | rhs | ) | const

inline constexpr

## operator|() [2/2]

template<int N>
template<typename rhstype, std::enable_if_t<(std::is_integral_v< rhstype >||(sizeof(rhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< rhstype >)), int > = 0>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator| | ( | const rhstype & | rhs | ) | const

inline constexpr

## operator|=()

template<int N>
template<typename rhstype>

TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator|= | ( | const rhstype & | rhs | ) |

inline constexpr

## operator~()

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator~ | ( |  | ) | const

inline constexpr

## pow()

template<int N>

BigUInt tlfloat::BigUInt< N >::pow | ( | BigUInt< N > | e,
|  | const BigUInt< N > & | m = 0,
|  | BigUInt< N > | recm = 0 ) const

inline constexpr

## reciprocal()

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::reciprocal | ( |  | ) | const

inline constexpr

This method returns ((1 << N) / *this)

## reciprocal2()

template<int N>

TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::reciprocal2 | ( |  | ) | const

inline constexpr

This method returns approximation of (((1 << (N*2))-1) / ((1 << ((1 << N)-1)) | *this) - (1 << ((1 << N))))

## setWord()

template<int N>

TLFLOAT_INLINE void tlfloat::BigUInt< N >::setWord | ( | unsigned | idx,
|  | uint64_t | u )

inline constexpr

## Friends And Related Symbol Documentation

## BigInt

template<int N>
template<int>

friend class BigInt

friend

## BigUInt

template<int N>
template<int>

friend class BigUInt

friend

## operator!=

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend bool operator!= | ( | const lhstype & | lhs,
|  | const BigUInt< N > & | rhs )

friend

## operator%

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator% | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## operator&

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator& | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## operator*

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator* | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## operator+

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator+ | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## operator-

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator- | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## operator/

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator/ | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## operator<

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend bool operator< | ( | const lhstype & | lhs,
|  | const BigUInt< N > & | rhs )

friend

## operator<=

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend bool operator<= | ( | const lhstype & | lhs,
|  | const BigUInt< N > & | rhs )

friend

## operator==

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend bool operator== | ( | const lhstype & | lhs,
|  | const BigUInt< N > & | rhs )

friend

## operator>

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend bool operator> | ( | const lhstype & | lhs,
|  | const BigUInt< N > & | rhs )

friend

## operator>=

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend bool operator>= | ( | const lhstype & | lhs,
|  | const BigUInt< N > & | rhs )

friend

## operator^

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator^ | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## operator|

template<int N>
template<typename lhstype, std::enable_if_t<(std::is_integral_v< lhstype >||(sizeof(lhstype)<(8<<(N - 6)) &&!std::is_floating_point_v< lhstype >)), int > = 0>

TLFLOAT_INLINE friend BigUInt operator| | ( | const lhstype | c,
|  | const BigUInt< N > & | rhs )

friend

## TLFloat

template<int N>
template<typename Unpacked_t>

friend class TLFloat

friend

## Member Data Documentation

## high

template<int N>

BigUInt<N-1> tlfloat::BigUInt< N >::high = 0

## low

template<int N>

BigUInt<N-1> tlfloat::BigUInt< N >::low = 0

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

- src/include/tlfloat/bigint.hpp