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 p) |
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 60 of file uint128_t.hpp.
|
inlineexplicit |
Parameterized constructor.
T | integral type |
low | lower part 8-bit unisgned integer |
Definition at line 101 of file uint128_t.hpp.
|
inlineexplicit |
Parameterized constructor.
str | Integer string (hexadecimal starting with 0x.. or decimal) |
Definition at line 107 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 116 of file uint128_t.hpp.
|
default |
Copy constructor.
num | 128-bit unsigned integer |
|
inlinenoexcept |
Move constructor.
num | 128-bit unsigned integer |
Definition at line 128 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 70 of file uint128_t.hpp.
|
inline |
Leading zeroes in binary.
Calculates leading zeros in 128-bit integer
Definition at line 140 of file uint128_t.hpp.
|
inline |
Trailing zeroes in binary.
Calculates leading zeros in 128-bit integer
Definition at line 163 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 455 of file uint128_t.hpp.
|
inline |
returns lower 64-bit integer part
Definition at line 202 of file uint128_t.hpp.
|
inlineexplicit |
casting operator to boolean value
Definition at line 185 of file uint128_t.hpp.
|
inlineexplicit |
casting operator to any integer valu
T | any integer type |
Definition at line 194 of file uint128_t.hpp.
|
inline |
operator ! for uint128_t
Definition at line 628 of file uint128_t.hpp.
|
inline |
operator != for other types
T | integral type |
other | number to be compared with this |
Definition at line 722 of file uint128_t.hpp.
|
inline |
operator != for uint128_t
other | number to be compared with this |
Definition at line 620 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 543 of file uint128_t.hpp.
operator % for uint128_t
p | 128-bit unsigned integer |
Definition at line 533 of file uint128_t.hpp.
|
inline |
operator %= for uint128_t
T | denoting integral type |
p | a type of integer variable |
Definition at line 565 of file uint128_t.hpp.
operator %= for uint128_t
p | 128-bit unsigned integer |
Definition at line 552 of file uint128_t.hpp.
|
inline |
operator & for other types (bitwise operator)
T | integral type |
p | number to be operated |
Definition at line 856 of file uint128_t.hpp.
operator & for uint128_t (bitwise operator)
p | number to be operated |
Definition at line 844 of file uint128_t.hpp.
|
inline |
operator && for other types
T | integral type |
other | number to be compared with this |
Definition at line 734 of file uint128_t.hpp.
|
inline |
operator && for uint128_t
b | number to be compared with this |
Definition at line 635 of file uint128_t.hpp.
|
inline |
operator &= for other types (bitwise operator)
T | integral type |
p | number to be operated |
Definition at line 880 of file uint128_t.hpp.
operator &= for uint128_t (bitwise operator)
p | number to be operated |
Definition at line 866 of file uint128_t.hpp.
|
inline |
operator () for uint128_t
Definition at line 652 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 393 of file uint128_t.hpp.
operator * for uint128_t and other integer types.
p | 128-bit unsigned integer |
Definition at line 402 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 424 of file uint128_t.hpp.
operator *= for uint128_t and other integer types.
p | 128-bit unsigned integer |
Definition at line 434 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 253 of file uint128_t.hpp.
operator + for uint128_t and other integer types.
p | 128-bit unsigned integer |
Definition at line 262 of file uint128_t.hpp.
|
inline |
pre-increment operator
Definition at line 297 of file uint128_t.hpp.
|
inline |
post-increment operator
Definition at line 306 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 274 of file uint128_t.hpp.
operator += for uint128_t
p | 128-bit unsigned integer |
Definition at line 286 of file uint128_t.hpp.
|
inline |
operator - using twos complement
Definition at line 338 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 319 of file uint128_t.hpp.
operator - for uint128_t
p | a type of integer variable |
Definition at line 329 of file uint128_t.hpp.
|
inline |
operator – (pre-decrement)
Definition at line 344 of file uint128_t.hpp.
|
inline |
operator – (post-decrement)
Definition at line 353 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 366 of file uint128_t.hpp.
operator -= for uint128_t
p | 128-bit unsigned integer |
Definition at line 378 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 499 of file uint128_t.hpp.
operator / for uint128_t and other integer types.
p | 128-bit unsigned integer |
Definition at line 489 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 523 of file uint128_t.hpp.
operator /= for uint128_t
p | 128-bit unsigned integer |
Definition at line 510 of file uint128_t.hpp.
|
inline |
operator < for other types
T | integral type |
other | number to be compared with this |
Definition at line 662 of file uint128_t.hpp.
|
inline |
operator < for uint128_t
other | number to be compared with this |
Definition at line 575 of file uint128_t.hpp.
|
inline |
operator << for uint128_t
T | integral type |
p | number denoting number of shifts |
Definition at line 765 of file uint128_t.hpp.
|
inline |
operator <<= for uint128_t
T | integral type |
p | number denoting number of shifts |
Definition at line 785 of file uint128_t.hpp.
|
inline |
operator <= for other types
T | integral type |
other | number to be compared with this |
Definition at line 674 of file uint128_t.hpp.
|
inline |
operator <= for uint128_t
other | number to be compared with this |
Definition at line 584 of file uint128_t.hpp.
|
inline |
operator = for type string
p | a string to assign it's value to equivalent integer |
p
Definition at line 228 of file uint128_t.hpp.
|
inline |
operator = for other types
T | denoting any integer type |
p | an integer to assign it's value |
p
Definition at line 218 of file uint128_t.hpp.
operator = for uint128_t
p | an 128-bit integer to assign it's value |
p
|
inline |
operator == for other types
T | integral type |
other | number to be compared with this |
Definition at line 710 of file uint128_t.hpp.
|
inline |
operator == for uint128_t
other | number to be compared with this |
Definition at line 611 of file uint128_t.hpp.
|
inline |
operator > for other types
T | integral type |
other | number to be compared with this |
Definition at line 686 of file uint128_t.hpp.
|
inline |
operator > for uint128_t
other | number to be compared with this |
Definition at line 593 of file uint128_t.hpp.
|
inline |
operator >= for other types
T | integral type |
other | number to be compared with this |
Definition at line 698 of file uint128_t.hpp.
|
inline |
operator >= for uint128_t
other | number to be compared with this |
Definition at line 602 of file uint128_t.hpp.
|
inline |
operator >> for uint128_t
T | integral type |
p | number denoting number of shifts |
Definition at line 806 of file uint128_t.hpp.
|
inline |
operator >>= for uint128_t
T | integral type |
p | number denoting number of shifts |
Definition at line 826 of file uint128_t.hpp.
|
inline |
operator ^ for other types (bitwise operator)
T | integral type |
p | number to be operated |
Definition at line 938 of file uint128_t.hpp.
operator ^ for uint128_t (bitwise operator)
p | number to be operated |
Definition at line 947 of file uint128_t.hpp.
|
inline |
operator ^= for other types (bitwise operator)
T | integral type |
p | number to be operated |
Definition at line 970 of file uint128_t.hpp.
operator ^= for uint128_t (bitwise operator)
p | number to be operated |
Definition at line 956 of file uint128_t.hpp.
|
inline |
operator | for other types (bitwise operator)
T | integral type |
p | number to be operated |
Definition at line 893 of file uint128_t.hpp.
operator | for uint128_t (bitwise operator)
p | number to be operated |
Definition at line 902 of file uint128_t.hpp.
|
inline |
operator |= for other types (bitwise operator)
T | integral type |
p | number to be operated |
Definition at line 925 of file uint128_t.hpp.
operator |= for uint128_t (bitwise operator)
p | number to be operated |
Definition at line 911 of file uint128_t.hpp.
|
inline |
operator || for other types
T | integral type |
other | number to be compared with this |
Definition at line 747 of file uint128_t.hpp.
|
inline |
operator || for uint128_t
b | number to be compared with this |
Definition at line 644 of file uint128_t.hpp.
|
inline |
operator ~ for uint128_t
Definition at line 755 of file uint128_t.hpp.
|
inline |
returns upper 64-bit integer part
Definition at line 208 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 984 of file uint128_t.hpp.
|
private |
Definition at line 61 of file uint128_t.hpp.
|
private |
Definition at line 61 of file uint128_t.hpp.