A signed 128‐bit integer type.
Synopsis
Declared in <absl/numeric/int128.h>
class int128;
Description
The API is meant to mimic an intrinsic integral type as closely as is practical, including exhibiting undefined behavior in analogous cases (e.g. division by zero).
An int128 supports the following:
* Implicit construction from integral types * Explicit conversion to integral types
However, an int128 differs from intrinsic integral types in the following ways:
* It is not implicitly convertible to other integral types. * Requires explicit construction from and conversion to floating point types.
Additionally, if your compiler supports __int128, int128 is interoperable with that type. (Abseil checks for this compatibility through the ABSL_HAVE_INTRINSIC_INT128 macro.)
The design goal for int128 is that it will be compatible with a future int128_t, if that type becomes a part of the standard.
Example:
float y = absl::int128(17); // Error. int128 cannot be implicitly // converted to float.
absl::int128 v; int64_t i = v; // Error int64_t i = static_cast<int64_t>(v); // OK
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
Divides this value by |
|
Applies a bitwise AND with |
|
Multiplies this value by |
|
Increment operators |
|
Adds |
|
Decrement operators |
|
Subtracts |
|
Divides this value by |
|
Shifts this value left by |
|
Shifts this value right by |
|
Applies a bitwise XOR with |
|
Applies a bitwise OR with |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
|
Converts this |
Friends
Name |
Description |
Appends the decimal representation of this value to a sink, supporting |
|
Combines this value into a hash state, supporting |
|
Returns the minimum value for a 128‐bit signed integer. |
|
Returns the maximum value for a 128‐bit signed integer. |
|
Constructs an |
|
Returns the higher 64‐bit value of an |
|
Returns the lower 64‐bit value of an |
Non-Member Functions
Name |
Description |
Determines whether |
|
Returns the remainder of |
|
Returns the bitwise AND of |
|
Returns the product of |
|
Returns the sum of |
|
Returns the unary plus of |
|
Returns the difference of |
|
Returns the arithmetic negation of |
|
Returns the quotient of |
|
Shifts |
|
Shifts |
|
Returns the bitwise XOR of |
|
Returns the bitwise OR of |
Created with MrDocs