![]() |
TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
class for 128-bit unsigned integer More...
#include <uint128_t.hpp>
Public Member Functions | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t (T low) | |
| Parameterized constructor. | |
| uint128_t (const std::string &str) | |
| Parameterized constructor. | |
| uint128_t (const uint64_t high, const uint64_t low) | |
| Parameterized constructor. | |
| uint128_t (const uint128_t &num)=default | |
| Copy constructor. | |
| uint128_t (uint128_t &&num) noexcept | |
| Move constructor. | |
| ~uint128_t ()=default | |
| Destructor for uint128_t. | |
| uint32_t | _lez () |
| Leading zeroes in binary. | |
| uint32_t | _trz () |
| Trailing zeroes in binary. | |
| operator bool () const | |
| casting operator to boolean value | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| operator T () const | |
| casting operator to any integer valu | |
| uint64_t | lower () const |
| returns lower 64-bit integer part | |
| uint64_t | upper () const |
| returns upper 64-bit integer part | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator= (const T &p) |
| operator = for other types | |
| uint128_t & | operator= (const std::string &p) |
| operator = for type string | |
| uint128_t & | operator= (const uint128_t &p)=default |
| operator = for uint128_t | |
| uint128_t & | operator= (uint128_t &&p)=default |
| Move assignment operator. | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator+ (const T p) |
| operator + for uint128_t and other integer types. | |
| uint128_t | operator+ (const uint128_t &p) |
| operator + for uint128_t and other integer types. | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator+= (const T p) |
| operator += for uint128_t and other integer types. | |
| uint128_t & | operator+= (const uint128_t &p) |
| operator += for uint128_t | |
| uint128_t & | operator++ () |
| pre-increment operator | |
| uint128_t | operator++ (int) |
| post-increment operator | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator- (const T &p) |
| operator - for uint128_t and other integer types. | |
| uint128_t | operator- (const uint128_t &p) |
| operator - for uint128_t | |
| uint128_t | operator- () |
| operator - using twos complement | |
| uint128_t & | operator-- () |
| operator – (pre-decrement) | |
| uint128_t | operator-- (int) |
| operator – (post-decrement) | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator-= (const T &p) |
| operator -= for uint128_t and other integer types. | |
| uint128_t & | operator-= (const uint128_t &p) |
| operator -= for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator* (const T p) |
| operator * for uint128_t and other integer types. | |
| uint128_t | operator* (const uint128_t &p) |
| operator * for uint128_t and other integer types. | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator*= (const T p) |
| operator *= for uint128_t and other integer types. | |
| uint128_t & | operator*= (const uint128_t &p) |
| operator *= for uint128_t and other integer types. | |
| std::pair< uint128_t, uint128_t > | divide (const uint128_t &p) |
| divide function for uint128_t and other integer types. | |
| uint128_t | operator/ (const uint128_t &p) |
| operator / for uint128_t and other integer types. | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator/ (const T p) |
| operator / for uint128_t and other integer types. | |
| uint128_t & | operator/= (const uint128_t &p) |
| operator /= for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator/= (const T p) |
| operator /= for uint128_t and other integer types. | |
| uint128_t | operator% (const uint128_t &p) |
| operator % for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator% (const T &p) |
| operator % for uint128_t and other integer types. | |
| uint128_t & | operator%= (const uint128_t &p) |
| operator %= for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator%= (const T &p) |
| operator %= for uint128_t | |
| bool | operator< (const uint128_t &other) |
| operator < for uint128_t | |
| bool | operator<= (const uint128_t &other) |
| operator <= for uint128_t | |
| bool | operator> (const uint128_t &other) |
| operator > for uint128_t | |
| bool | operator>= (const uint128_t &other) |
| operator >= for uint128_t | |
| bool | operator== (const uint128_t &other) |
| operator == for uint128_t | |
| bool | operator!= (const uint128_t &other) |
| operator != for uint128_t | |
| bool | operator! () |
| operator ! for uint128_t | |
| bool | operator&& (const uint128_t &b) |
| operator && for uint128_t | |
| bool | operator|| (const uint128_t &b) |
| operator || for uint128_t | |
| bool | operator() () |
| operator () for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator< (const T other) |
| operator < for other types | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator<= (const T other) |
| operator <= for other types | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator> (const T other) |
| operator > for other types | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator>= (const T other) |
| operator >= for other types | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator== (const T other) |
| operator == for other types | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator!= (const T other) |
| operator != for other types | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator&& (const T b) |
| operator && for other types | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| bool | operator|| (const T b) |
| operator || for other types | |
| uint128_t | operator~ () |
| operator ~ for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator<< (const T p) |
| operator << for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator<<= (const T p) |
| operator <<= for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator>> (const T p) |
| operator >> for uint128_t | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator>>= (const T p) |
| operator >>= for uint128_t | |
| uint128_t | operator& (const uint128_t &p) |
| operator & for uint128_t (bitwise operator) | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator& (const T p) |
| operator & for other types (bitwise operator) | |
| uint128_t & | operator&= (const uint128_t &p) |
| operator &= for uint128_t (bitwise operator) | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator&= (const T p) |
| operator &= for other types (bitwise operator) | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator| (const T p) |
| operator | for other types (bitwise operator) | |
| uint128_t | operator| (const uint128_t &p) |
| operator | for uint128_t (bitwise operator) | |
| uint128_t & | operator|= (const uint128_t &p) |
| operator |= for uint128_t (bitwise operator) | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator|= (const T p) |
| operator |= for other types (bitwise operator) | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t | operator^ (const T p) |
| operator ^ for other types (bitwise operator) | |
| uint128_t | operator^ (const uint128_t &p) |
| operator ^ for uint128_t (bitwise operator) | |
| uint128_t & | operator^= (const uint128_t &p) |
| operator ^= for uint128_t (bitwise operator) | |
| template<typename T, typename = typename std::enable_if< std::is_integral<T>::value, T>::type> | |
| uint128_t & | operator^= (const T &p) |
| operator ^= for other types (bitwise operator) | |
Private Member Functions | |
| void | __get_integer_from_string (const std::string &str) |
| First and second half of 128 bit number. | |
Private Attributes | |
| uint64_t | f {} |
| uint64_t | s {} |
Friends | |
| std::ostream & | operator<< (std::ostream &op, const uint128_t &p) |
| operator << for printing uint128_t integer | |
class for 128-bit unsigned integer
Definition at line 53 of file uint128_t.hpp.
|
inlineexplicit |
Parameterized constructor.
| T | integral type |
| low | lower part 8-bit unisgned integer |
Definition at line 94 of file uint128_t.hpp.
|
inlineexplicit |
Parameterized constructor.
| str | Integer string (hexadecimal starting with 0x.. or decimal) |
Definition at line 100 of file uint128_t.hpp.
|
inline |
Parameterized constructor.
| high | higher part 64-bit unsigned integer |
| low | lower part 64-bit unsigned integer |
Definition at line 109 of file uint128_t.hpp.
|
default |
Copy constructor.
| num | 128-bit unsigned integer |
|
inlinenoexcept |
Move constructor.
| num | 128-bit unsigned integer |
Definition at line 121 of file uint128_t.hpp.
|
inlineprivate |
First and second half of 128 bit number.
Get integer from given string.
Create an integer from a given string
| str | integer string, can be hexadecimal (starting on 0x... or number) |
Definition at line 63 of file uint128_t.hpp.
|
inline |
Leading zeroes in binary.
Calculates leading zeros in 128-bit integer
Definition at line 133 of file uint128_t.hpp.
|
inline |
Trailing zeroes in binary.
Calculates leading zeros in 128-bit integer
Definition at line 156 of file uint128_t.hpp.
divide function for uint128_t and other integer types.
divide this value and
| p | 128-bit unsigned integer |
Definition at line 448 of file uint128_t.hpp.
|
inline |
returns lower 64-bit integer part
Definition at line 195 of file uint128_t.hpp.
|
inlineexplicit |
casting operator to boolean value
Definition at line 178 of file uint128_t.hpp.
|
inlineexplicit |
casting operator to any integer valu
| T | any integer type |
Definition at line 187 of file uint128_t.hpp.
|
inline |
operator ! for uint128_t
Definition at line 621 of file uint128_t.hpp.
|
inline |
operator != for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 715 of file uint128_t.hpp.
|
inline |
operator != for uint128_t
| other | number to be compared with this |
Definition at line 613 of file uint128_t.hpp.
|
inline |
operator % for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 536 of file uint128_t.hpp.
operator % for uint128_t
| p | 128-bit unsigned integer |
Definition at line 526 of file uint128_t.hpp.
|
inline |
operator %= for uint128_t
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 558 of file uint128_t.hpp.
operator %= for uint128_t
| p | 128-bit unsigned integer |
Definition at line 545 of file uint128_t.hpp.
|
inline |
operator & for other types (bitwise operator)
| T | integral type |
| p | number to be operated |
Definition at line 849 of file uint128_t.hpp.
operator & for uint128_t (bitwise operator)
| p | number to be operated |
Definition at line 837 of file uint128_t.hpp.
|
inline |
operator && for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 727 of file uint128_t.hpp.
|
inline |
operator && for uint128_t
| b | number to be compared with this |
Definition at line 628 of file uint128_t.hpp.
|
inline |
operator &= for other types (bitwise operator)
| T | integral type |
| p | number to be operated |
Definition at line 873 of file uint128_t.hpp.
operator &= for uint128_t (bitwise operator)
| p | number to be operated |
Definition at line 859 of file uint128_t.hpp.
|
inline |
operator () for uint128_t
Definition at line 645 of file uint128_t.hpp.
|
inline |
operator * for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 386 of file uint128_t.hpp.
operator * for uint128_t and other integer types.
| p | 128-bit unsigned integer |
Definition at line 395 of file uint128_t.hpp.
|
inline |
operator *= for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 417 of file uint128_t.hpp.
operator *= for uint128_t and other integer types.
| p | 128-bit unsigned integer |
Definition at line 427 of file uint128_t.hpp.
|
inline |
operator + for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 246 of file uint128_t.hpp.
operator + for uint128_t and other integer types.
| p | 128-bit unsigned integer |
Definition at line 255 of file uint128_t.hpp.
|
inline |
pre-increment operator
Definition at line 290 of file uint128_t.hpp.
|
inline |
post-increment operator
Definition at line 299 of file uint128_t.hpp.
|
inline |
operator += for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 267 of file uint128_t.hpp.
operator += for uint128_t
| p | 128-bit unsigned integer |
Definition at line 279 of file uint128_t.hpp.
|
inline |
operator - using twos complement
Definition at line 331 of file uint128_t.hpp.
|
inline |
operator - for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 312 of file uint128_t.hpp.
operator - for uint128_t
| p | a type of integer variable |
Definition at line 322 of file uint128_t.hpp.
|
inline |
operator – (pre-decrement)
Definition at line 337 of file uint128_t.hpp.
|
inline |
operator – (post-decrement)
Definition at line 346 of file uint128_t.hpp.
|
inline |
operator -= for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 359 of file uint128_t.hpp.
operator -= for uint128_t
| p | 128-bit unsigned integer |
Definition at line 371 of file uint128_t.hpp.
|
inline |
operator / for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 492 of file uint128_t.hpp.
operator / for uint128_t and other integer types.
| p | 128-bit unsigned integer |
Definition at line 482 of file uint128_t.hpp.
|
inline |
operator /= for uint128_t and other integer types.
| T | denoting integral type |
| p | a type of integer variable |
Definition at line 516 of file uint128_t.hpp.
operator /= for uint128_t
| p | 128-bit unsigned integer |
Definition at line 503 of file uint128_t.hpp.
|
inline |
operator < for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 655 of file uint128_t.hpp.
|
inline |
operator < for uint128_t
| other | number to be compared with this |
Definition at line 568 of file uint128_t.hpp.
|
inline |
operator << for uint128_t
| T | integral type |
| p | number denoting number of shifts |
Definition at line 758 of file uint128_t.hpp.
|
inline |
operator <<= for uint128_t
| T | integral type |
| p | number denoting number of shifts |
Definition at line 778 of file uint128_t.hpp.
|
inline |
operator <= for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 667 of file uint128_t.hpp.
|
inline |
operator <= for uint128_t
| other | number to be compared with this |
Definition at line 577 of file uint128_t.hpp.
|
inline |
operator = for type string
| p | a string to assign it's value to equivalent integer |
Definition at line 221 of file uint128_t.hpp.
|
inline |
operator = for other types
| T | denoting any integer type |
| p | an integer to assign it's value |
Definition at line 211 of file uint128_t.hpp.
operator = for uint128_t
| p | an 128-bit integer to assign it's value |
|
inline |
operator == for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 703 of file uint128_t.hpp.
|
inline |
operator == for uint128_t
| other | number to be compared with this |
Definition at line 604 of file uint128_t.hpp.
|
inline |
operator > for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 679 of file uint128_t.hpp.
|
inline |
operator > for uint128_t
| other | number to be compared with this |
Definition at line 586 of file uint128_t.hpp.
|
inline |
operator >= for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 691 of file uint128_t.hpp.
|
inline |
operator >= for uint128_t
| other | number to be compared with this |
Definition at line 595 of file uint128_t.hpp.
|
inline |
operator >> for uint128_t
| T | integral type |
| p | number denoting number of shifts |
Definition at line 799 of file uint128_t.hpp.
|
inline |
operator >>= for uint128_t
| T | integral type |
| p | number denoting number of shifts |
Definition at line 819 of file uint128_t.hpp.
|
inline |
operator ^ for other types (bitwise operator)
| T | integral type |
| p | number to be operated |
Definition at line 931 of file uint128_t.hpp.
operator ^ for uint128_t (bitwise operator)
| p | number to be operated |
Definition at line 940 of file uint128_t.hpp.
|
inline |
operator ^= for other types (bitwise operator)
| T | integral type |
| p | number to be operated |
Definition at line 963 of file uint128_t.hpp.
operator ^= for uint128_t (bitwise operator)
| p | number to be operated |
Definition at line 949 of file uint128_t.hpp.
|
inline |
operator | for other types (bitwise operator)
| T | integral type |
| p | number to be operated |
Definition at line 886 of file uint128_t.hpp.
operator | for uint128_t (bitwise operator)
| p | number to be operated |
Definition at line 895 of file uint128_t.hpp.
|
inline |
operator |= for other types (bitwise operator)
| T | integral type |
| p | number to be operated |
Definition at line 918 of file uint128_t.hpp.
operator |= for uint128_t (bitwise operator)
| p | number to be operated |
Definition at line 904 of file uint128_t.hpp.
|
inline |
operator || for other types
| T | integral type |
| other | number to be compared with this |
Definition at line 740 of file uint128_t.hpp.
|
inline |
operator || for uint128_t
| b | number to be compared with this |
Definition at line 637 of file uint128_t.hpp.
|
inline |
operator ~ for uint128_t
Definition at line 748 of file uint128_t.hpp.
|
inline |
returns upper 64-bit integer part
Definition at line 201 of file uint128_t.hpp.
|
friend |
operator << for printing uint128_t integer
Prints the uint128_t integer in decimal form
| op | ostream object |
| p | 128-bit integer |
Definition at line 977 of file uint128_t.hpp.
|
private |
Definition at line 54 of file uint128_t.hpp.
|
private |
Definition at line 54 of file uint128_t.hpp.