|
constexpr TLFLOAT_INLINE | BigInt ()=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 | BigInt (T i) |
|
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 | BigInt (T u) |
|
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 | BigInt (const BigUInt< N > &up) |
|
template<int K, std::enable_if_t<(K<(N-1))> * = nullptr> |
constexpr TLFLOAT_INLINE | BigInt (const BigInt< K > &l) |
|
template<int K, std::enable_if_t<(K==(N-1))> * = nullptr> |
constexpr TLFLOAT_INLINE | BigInt (const BigInt< K > &l) |
|
constexpr TLFLOAT_INLINE | BigInt (const BigInt &m)=default |
|
template<int K, std::enable_if_t<(K==(N+1))> * = nullptr> |
constexpr TLFLOAT_INLINE | BigInt (const BigInt< K > &h) |
|
template<int K, std::enable_if_t<(K >(N+1))> * = nullptr> |
constexpr TLFLOAT_INLINE | BigInt (const BigInt< K > &h) |
|
constexpr TLFLOAT_INLINE | BigInt (const uint64_t *p) |
|
constexpr TLFLOAT_INLINE | BigInt (double d) |
|
constexpr TLFLOAT_INLINE | operator double () const |
|
constexpr TLFLOAT_INLINE | operator BigUInt< N > () const |
|
constexpr TLFLOAT_INLINE BigInt | abs () const |
|
constexpr TLFLOAT_INLINE BigInt & | operator= (const BigInt &ip)=default |
|
constexpr TLFLOAT_INLINE BigInt & | operator++ () |
|
constexpr TLFLOAT_INLINE BigInt | operator++ (int) |
|
constexpr TLFLOAT_INLINE BigInt & | operator-- () |
|
constexpr TLFLOAT_INLINE BigInt | operator-- (int) |
|
constexpr TLFLOAT_INLINE BigInt | operator+ (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator- (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator- () const |
|
constexpr TLFLOAT_INLINE BigInt | operator+ () const |
|
constexpr TLFLOAT_INLINE BigInt | operator* (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator/ (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator% (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE bool | isNegative () const |
|
constexpr TLFLOAT_INLINE bool | isZero () const |
|
constexpr TLFLOAT_INLINE BigInt | divmod (const BigInt &rhs, const BigUInt< N > &recip, BigInt *mod) const |
|
constexpr TLFLOAT_INLINE BigInt | pow (BigUInt< N > e, const BigUInt< N > &m=0, BigUInt< N > recm=0) const |
|
constexpr TLFLOAT_INLINE BigUInt< N > | reciprocal () const |
|
constexpr TLFLOAT_INLINE int64_t | getWord (unsigned idx) const |
|
constexpr TLFLOAT_INLINE bool | operator== (BigInt const &rhs) const |
|
constexpr TLFLOAT_INLINE bool | operator!= (BigInt const &rhs) const |
|
constexpr TLFLOAT_INLINE int | compare (BigInt const &rhs) const |
|
constexpr TLFLOAT_INLINE bool | operator> (BigInt const &rhs) const |
|
constexpr TLFLOAT_INLINE bool | operator< (BigInt const &rhs) const |
|
constexpr TLFLOAT_INLINE bool | operator<= (BigInt const &rhs) const |
|
constexpr TLFLOAT_INLINE bool | operator>= (BigInt const &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator& (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator| (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator^ (const BigInt &rhs) const |
|
constexpr TLFLOAT_INLINE BigInt | operator~ () const |
|
constexpr TLFLOAT_INLINE BigInt | operator>> (int n) const |
|
constexpr TLFLOAT_INLINE BigInt | operator<< (int n) const |
|
constexpr TLFLOAT_INLINE BigInt & | operator>>= (int n) |
|
constexpr TLFLOAT_INLINE BigInt & | 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 BigInt | 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 BigInt | 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 BigInt | 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 BigInt | 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 BigInt | 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 BigInt | 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 BigInt | 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 BigInt | 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 BigInt & | operator= (const srctype &s) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator+= (const rhstype &rhs) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator-= (const rhstype &rhs) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator*= (const rhstype &rhs) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator/= (const rhstype &rhs) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator%= (const rhstype &rhs) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator&= (const rhstype &rhs) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator|= (const rhstype &rhs) |
|
template<typename rhstype > |
constexpr TLFLOAT_INLINE BigInt & | operator^= (const rhstype &rhs) |
|
constexpr TLFLOAT_INLINE | BigInt (const char *p, const char **endptr=nullptr, const int base=10) |
|
|
template<int > |
class | BigUInt |
|
template<int > |
class | BigInt |
|
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 BigInt | operator+ (const lhstype c, const BigInt &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 BigInt | operator- (const lhstype c, const BigInt &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 BigInt | operator* (const lhstype c, const BigInt &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 BigInt | operator/ (const lhstype c, const BigInt &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 BigInt | operator% (const lhstype c, const BigInt &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 BigInt | operator& (const lhstype c, const BigInt &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 BigInt | operator| (const lhstype c, const BigInt &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 BigInt | operator^ (const lhstype c, const BigInt &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 BigInt &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 BigInt &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 BigInt &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 BigInt &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 BigInt &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 BigInt &rhs) |
|
template<int N>
class tlfloat::BigInt< N >
This is a trivially copyable template class that represents an arbitrary precision signed integer. It can represent an integer between -(2^(N-1)) and 2^(N-1)-1. The data size of an object is N bits, where N must be 7 or greater.