TLFloat
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Friends | List of all members
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 BigUIntoperator= (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 BigUIntoperator++ ()
 
constexpr TLFLOAT_INLINE BigUIntoperator-- ()
 
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 BigUIntoperator<<= (int n)
 
constexpr TLFLOAT_INLINE BigUIntoperator>>= (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 BigUIntoperator= (const srctype &s)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator+= (const rhstype &rhs)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator-= (const rhstype &rhs)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator*= (const rhstype &rhs)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator/= (const rhstype &rhs)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator%= (const rhstype &rhs)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator&= (const rhstype &rhs)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator|= (const rhstype &rhs)
 
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUIntoperator^= (const rhstype &rhs)
 
constexpr TLFLOAT_INLINE BigUIntoperator+= (bool rhs)
 
constexpr TLFLOAT_INLINE BigUInt divmod (const BigUInt &rhs, const BigUInt &recip, BigUInt *mod) const
 
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUIntdivmod (const BigUInt &rhs, const BigUInt &recip) const
 
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUIntdivmod (const BigUInt &rhs) const
 
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUIntdivmod2 (const BigUInt &rhs, const BigUInt &recip2) const
 
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUIntdivmod2 (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>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( const BigUInt< N-1 > &  h,
const BigUInt< N-1 > &  l 
)
inlineconstexpr

◆ BigUInt() [2/11]

template<int N>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( )
constexprdefault

◆ 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>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( u)
inlineconstexpr

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>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( i)
inlineconstexpr

Cast from any primitive signed integer

◆ BigUInt() [5/11]

template<int N>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( const BigUInt< N > &  m)
constexprdefault

◆ BigUInt() [6/11]

template<int N>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( const BigUInt< N+1 > &  h)
inlineexplicitconstexpr

◆ BigUInt() [7/11]

template<int N>
template<int K, std::enable_if_t<(K< N)> * = nullptr>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( const BigUInt< K > &  l)
inlineconstexpr

◆ BigUInt() [8/11]

template<int N>
template<int K, std::enable_if_t<(K >(N+1))> * = nullptr>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( const BigUInt< K > &  h)
inlineexplicitconstexpr

◆ BigUInt() [9/11]

template<int N>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::BigUInt ( const uint64_t *  p)
inlineconstexpr

◆ BigUInt() [10/11]

template<int N>
constexpr tlfloat::BigUInt< N >::BigUInt ( double  d)
inlineexplicitconstexpr

◆ BigUInt() [11/11]

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

Member Function Documentation

◆ bit()

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::bit ( unsigned  idx) const
inlineconstexpr

◆ clz()

template<int N>
constexpr TLFLOAT_INLINE unsigned tlfloat::BigUInt< N >::clz ( ) const
inlineconstexpr

◆ compare()

template<int N>
constexpr TLFLOAT_INLINE int tlfloat::BigUInt< N >::compare ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ divmod() [1/3]

template<int N>
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod ( const BigUInt< N > &  rhs) const
inlineconstexpr

This method performs division and modulo at a time.

◆ divmod() [2/3]

template<int N>
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod ( const BigUInt< N > &  rhs,
const BigUInt< N > &  recip 
) const
inlineconstexpr

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

◆ divmod() [3/3]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::divmod ( const BigUInt< N > &  rhs,
const BigUInt< N > &  recip,
BigUInt< N > *  mod 
) const
inlineconstexpr

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

◆ divmod2() [1/2]

template<int N>
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod2 ( const BigUInt< N > &  rhs) const
inlineconstexpr

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>
constexpr TLFLOAT_INLINE xpair< BigUInt, BigUInt > tlfloat::BigUInt< N >::divmod2 ( const BigUInt< N > &  rhs,
const BigUInt< N > &  recip2 
) const
inlineconstexpr

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>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::eq ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ gcd()

template<int N>
constexpr BigUInt tlfloat::BigUInt< N >::gcd ( BigUInt< N >  b) const
inlineconstexpr

◆ getWord()

template<int N>
constexpr TLFLOAT_INLINE uint64_t tlfloat::BigUInt< N >::getWord ( unsigned  idx) const
inlineconstexpr

◆ ilogbp1()

template<int N>
constexpr TLFLOAT_INLINE unsigned tlfloat::BigUInt< N >::ilogbp1 ( ) const
inlineconstexpr

◆ isAllOne()

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::isAllOne ( ) const
inlineconstexpr

◆ isZero()

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::isZero ( ) const
inlineconstexpr

◆ isZero2()

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::isZero2 ( ) const
inlineconstexpr

◆ mod()

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::mod ( const BigUInt< N > &  rhs,
const BigUInt< N > &  recip 
) const
inlineconstexpr

◆ msb()

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::msb ( ) const
inlineconstexpr

◆ operator bool()

template<int N>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::operator bool ( ) const
inlineexplicitconstexpr

◆ operator double()

template<int N>
constexpr tlfloat::BigUInt< N >::operator double ( ) const
inlineexplicitconstexpr

◆ 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>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::operator T ( ) const
inlineexplicitconstexpr

Cast to any primitive unsigned 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>
constexpr TLFLOAT_INLINE tlfloat::BigUInt< N >::operator T ( ) const
inlineexplicitconstexpr

Cast to any primitive signed integer

◆ operator!=() [1/2]

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator!= ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator!= ( const rhstype &  rhs) const
inlineconstexpr

◆ operator%() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator% ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator% ( const rhstype &  rhs) const
inlineconstexpr

◆ operator%=()

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator%= ( const rhstype &  rhs)
inlineconstexpr

◆ operator&() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator& ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator& ( const rhstype &  rhs) const
inlineconstexpr

◆ operator&=()

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator&= ( const rhstype &  rhs)
inlineconstexpr

◆ operator*() [1/3]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator* ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ operator*() [2/3]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator* ( const BigUInt< N-1 > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator* ( const rhstype &  rhs) const
inlineconstexpr

◆ operator*=()

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator*= ( const rhstype &  rhs)
inlineconstexpr

◆ operator+() [1/5]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ ( ) const
inlineconstexpr

◆ operator+() [2/5]

template<int N>
template<int... , int K = N, std::enable_if_t<(K !=7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ operator+() [3/5]

template<int N>
template<int... , int K = N, std::enable_if_t<(K==7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ ( const BigUInt< N > &  rhs) const
inlineconstexpr

defined(TLFLOAT_ENABLE_INT128_OPT)

◆ operator+() [4/5]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ ( const BigUInt< N-1 > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator+ ( const rhstype &  rhs) const
inlineconstexpr

◆ operator++() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator++ ( )
inlineconstexpr

◆ operator++() [2/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator++ ( int  )
inlineconstexpr

◆ operator+=() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator+= ( bool  rhs)
inlineconstexpr

◆ operator+=() [2/2]

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator+= ( const rhstype &  rhs)
inlineconstexpr

◆ operator-() [1/5]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- ( ) const
inlineconstexpr

◆ operator-() [2/5]

template<int N>
template<int... , int K = N, std::enable_if_t<(K !=7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ operator-() [3/5]

template<int N>
template<int... , int K = N, std::enable_if_t<(K==7), int > = 0>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ operator-() [4/5]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- ( const BigUInt< N-1 > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator- ( const rhstype &  rhs) const
inlineconstexpr

◆ operator--() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator-- ( )
inlineconstexpr

◆ operator--() [2/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator-- ( int  )
inlineconstexpr

◆ operator-=()

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator-= ( const rhstype &  rhs)
inlineconstexpr

◆ operator/() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator/ ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator/ ( const rhstype &  rhs) const
inlineconstexpr

◆ operator/=()

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator/= ( const rhstype &  rhs)
inlineconstexpr

◆ operator<() [1/2]

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator< ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator< ( const rhstype &  rhs) const
inlineconstexpr

◆ operator<<()

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator<< ( int  n) const
inlineconstexpr

◆ operator<<=()

template<int N>
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator<<= ( int  n)
inlineconstexpr

◆ operator<=() [1/2]

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator<= ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator<= ( const rhstype &  rhs) const
inlineconstexpr

◆ operator=() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator= ( const BigUInt< N > &  u)
constexprdefault

◆ operator=() [2/2]

template<int N>
template<typename srctype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator= ( const srctype &  s)
inlineconstexpr

◆ operator==() [1/2]

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator== ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator== ( const rhstype &  rhs) const
inlineconstexpr

◆ operator>() [1/2]

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator> ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator> ( const rhstype &  rhs) const
inlineconstexpr

◆ operator>=() [1/2]

template<int N>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator>= ( BigUInt< N > const &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE bool tlfloat::BigUInt< N >::operator>= ( const rhstype &  rhs) const
inlineconstexpr

◆ operator>>()

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator>> ( int  n) const
inlineconstexpr

◆ operator>>=()

template<int N>
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator>>= ( int  n)
inlineconstexpr

◆ operator^() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator^ ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator^ ( const rhstype &  rhs) const
inlineconstexpr

◆ operator^=()

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator^= ( const rhstype &  rhs)
inlineconstexpr

◆ operator|() [1/2]

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator| ( const BigUInt< N > &  rhs) const
inlineconstexpr

◆ 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>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator| ( const rhstype &  rhs) const
inlineconstexpr

◆ operator|=()

template<int N>
template<typename rhstype >
constexpr TLFLOAT_INLINE BigUInt & tlfloat::BigUInt< N >::operator|= ( const rhstype &  rhs)
inlineconstexpr

◆ operator~()

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::operator~ ( ) const
inlineconstexpr

◆ pow()

template<int N>
constexpr BigUInt tlfloat::BigUInt< N >::pow ( BigUInt< N >  e,
const BigUInt< N > &  m = 0,
BigUInt< N >  recm = 0 
) const
inlineconstexpr

◆ reciprocal()

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::reciprocal ( ) const
inlineconstexpr

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

◆ reciprocal2()

template<int N>
constexpr TLFLOAT_INLINE BigUInt tlfloat::BigUInt< N >::reciprocal2 ( ) const
inlineconstexpr

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

◆ setWord()

template<int N>
constexpr TLFLOAT_INLINE void tlfloat::BigUInt< N >::setWord ( unsigned  idx,
uint64_t  u 
)
inlineconstexpr

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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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>
constexpr 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: