pub struct I384 { /* private fields */ }Expand description
The 384-bit signed integer type.
The high and low words depend on the target endianness.
Conversion to and from big endian should be done via
to_le_bytes and to_be_bytes.
Our formatting specifications are limited: we ignore a
lot of settings, and only respect alternate among the
formatter flags. So, we implement all the main formatters
(Binary, etc.), but ignore all flags like width.
Note that this type is NOT safe to use in FFIs, since the
underlying storage may use 128-bit integers in the future
which are not FFI-safe. If you would like to use this type
within a FFI, use to_le_bytes and to_be_bytes.
Implementations§
Source§impl I384
impl I384
Sourcepub const MIN: Self
pub const MIN: Self
The smallest value that can be represented by this integer type.
See i128::MIN.
Sourcepub const MAX: Self
pub const MAX: Self
The largest value that can be represented by this integer type (2256 - 1).
See i128::MAX.
Sourcepub const IS_SIGNED: bool = true
pub const IS_SIGNED: bool = true
If the integer is signed, that is, can contain negative numbers.
Sourcepub const fn min_value() -> Self
👎Deprecated
pub const fn min_value() -> Self
New code should prefer to use i128::MIN instead.
Returns the smallest value that can be represented by this integer type.
See i128::min_value.
Sourcepub const fn max_value() -> Self
👎Deprecated
pub const fn max_value() -> Self
New code should prefer to use i128::MAX instead.
Returns the largest value that can be represented by this integer type.
See i128::max_value.
Sourcepub const fn count_ones(self) -> u32
pub const fn count_ones(self) -> u32
Returns the number of ones in the binary representation of self.
See i128::count_ones.
Sourcepub const fn count_zeros(self) -> u32
pub const fn count_zeros(self) -> u32
Returns the number of zeros in the binary representation of self.
See i128::count_zeros.
Sourcepub const fn leading_zeros(self) -> u32
pub const fn leading_zeros(self) -> u32
Returns the number of leading zeros in the binary representation of
self.
Depending on what you’re doing with the value, you might also be
interested in the ilog2 function which returns a consistent
number, even if the type widens.
§Examples
let n = i256::MAX >> 2i32;
assert_eq!(n.leading_zeros(), 3);
let min = i256::MIN;
assert_eq!(min.leading_zeros(), 0);
let zero = i256::from_u8(0);
assert_eq!(zero.leading_zeros(), 256);
let max = i256::MAX;
assert_eq!(max.leading_zeros(), 1);See i128::leading_zeros.
Sourcepub const fn trailing_zeros(self) -> u32
pub const fn trailing_zeros(self) -> u32
Returns the number of trailing zeros in the binary representation of
self.
See i128::trailing_zeros.
Sourcepub const fn leading_ones(self) -> u32
pub const fn leading_ones(self) -> u32
Returns the number of leading ones in the binary representation of
self.
See i128::leading_ones.
Sourcepub const fn trailing_ones(self) -> u32
pub const fn trailing_ones(self) -> u32
Returns the number of trailing ones in the binary representation of
self.
See i128::trailing_ones.
Sourcepub const fn bitand_const(self, rhs: Self) -> Self
pub const fn bitand_const(self, rhs: Self) -> Self
Const implementation of BitAnd.
Sourcepub const fn bitor_const(self, rhs: Self) -> Self
pub const fn bitor_const(self, rhs: Self) -> Self
Const implementation of BitOr.
Sourcepub const fn bitxor_const(self, rhs: Self) -> Self
pub const fn bitxor_const(self, rhs: Self) -> Self
Const implementation of BitXor.
Sourcepub const fn rotate_left(self, n: u32) -> Self
pub const fn rotate_left(self, n: u32) -> Self
Shifts the bits to the left by a specified amount, n,
wrapping the truncated bits to the end of the resulting integer.
Please note this isn’t the same operation as the << shifting operator!
See i128::rotate_left.
Sourcepub const fn rotate_right(self, n: u32) -> Self
pub const fn rotate_right(self, n: u32) -> Self
Shifts the bits to the right by a specified amount, n,
wrapping the truncated bits to the beginning of the resulting
integer.
Please note this isn’t the same operation as the >> shifting operator!
See i128::rotate_right.
Sourcepub const fn wrapping_shl(self, rhs: u32) -> Self
pub const fn wrapping_shl(self, rhs: u32) -> Self
Panic-free bitwise shift-left; yields self << mask(rhs),
where mask removes any high-order bits of rhs that
would cause the shift to exceed the bitwidth of the type.
Note that this is not the same as a rotate-left; the
RHS of a wrapping shift-left is restricted to the range
of the type, rather than the bits shifted out of the LHS
being returned to the other end. The primitive integer
types all implement a rotate_left function,
which may be what you want instead.
See i128::wrapping_shl.
Sourcepub const fn wrapping_shr(self, rhs: u32) -> Self
pub const fn wrapping_shr(self, rhs: u32) -> Self
Panic-free bitwise shift-right; yields self >> mask(rhs),
where mask removes any high-order bits of rhs that
would cause the shift to exceed the bitwidth of the type.
Note that this is not the same as a rotate-right; the
RHS of a wrapping shift-right is restricted to the range
of the type, rather than the bits shifted out of the LHS
being returned to the other end. The primitive integer
types all implement a rotate_right function,
which may be what you want instead.
See i128::wrapping_shr.
Sourcepub const fn swap_bytes(&self) -> Self
pub const fn swap_bytes(&self) -> Self
Reverses the byte order of the integer.
§Assembly
This optimizes very nicely, with efficient bswap or rol
implementations for each.
See i128::swap_bytes.
Sourcepub const fn reverse_bits(&self) -> Self
pub const fn reverse_bits(&self) -> Self
Reverses the order of bits in the integer. The least significant bit becomes the most significant bit, second least-significant bit becomes second most-significant bit, etc.
See i128::reverse_bits.
Sourcepub const fn from_be(x: Self) -> Self
pub const fn from_be(x: Self) -> Self
Converts an integer from big endian to the target’s endianness.
On big endian this is a no-op. On little endian the bytes are swapped.
See i128::from_be.
Sourcepub const fn from_le(x: Self) -> Self
pub const fn from_le(x: Self) -> Self
Converts an integer from little endian to the target’s endianness.
On little endian this is a no-op. On big endian the bytes are swapped.
See i128::from_le.
Sourcepub const fn to_be(self) -> Self
pub const fn to_be(self) -> Self
Converts self to big endian from the target’s endianness.
On big endian this is a no-op. On little endian the bytes are swapped.
See i128::to_be.
Sourcepub const fn to_le(self) -> Self
pub const fn to_le(self) -> Self
Converts self to little endian from the target’s endianness.
On little endian this is a no-op. On big endian the bytes are swapped.
See i128::to_le.
Sourcepub const fn to_be_bytes(self) -> [u8; 48]
pub const fn to_be_bytes(self) -> [u8; 48]
Returns the memory representation of this integer as a byte array in big-endian (network) byte order.
See i128::to_be_bytes.
Sourcepub const fn to_le_bytes(self) -> [u8; 48]
pub const fn to_le_bytes(self) -> [u8; 48]
Returns the memory representation of this integer as a byte array in little-endian byte order.
See i128::to_le_bytes.
Sourcepub const fn to_ne_bytes(self) -> [u8; 48]
pub const fn to_ne_bytes(self) -> [u8; 48]
Returns the memory representation of this integer as a byte array in native byte order.
As the target platform’s native endianness is used, portable code
should use to_be_bytes or to_le_bytes, as appropriate,
instead.
See i128::to_ne_bytes.
Sourcepub const fn from_be_bytes(bytes: [u8; 48]) -> Self
pub const fn from_be_bytes(bytes: [u8; 48]) -> Self
Creates a native endian integer value from its representation as a byte array in big endian.
See i128::from_be_bytes.
Sourcepub const fn from_le_bytes(bytes: [u8; 48]) -> Self
pub const fn from_le_bytes(bytes: [u8; 48]) -> Self
Creates a native endian integer value from its representation as a byte array in little endian.
See i128::from_le_bytes.
Sourcepub const fn from_ne_bytes(bytes: [u8; 48]) -> Self
pub const fn from_ne_bytes(bytes: [u8; 48]) -> Self
Creates a native endian integer value from its memory representation as a byte array in native endianness.
As the target platform’s native endianness is used, portable code
likely wants to use from_be_bytes or from_le_bytes, as
appropriate instead.
See i128::from_ne_bytes.
Sourcepub const fn to_be_limbs(self) -> [ULimb; 12]
pub const fn to_be_limbs(self) -> [ULimb; 12]
Returns the memory representation of this as a series of limbs in big-endian (network) byte order.
The value of each limb stays the same, however, the order that each is stored within the buffer is in big-endian order.
Sourcepub const fn to_le_limbs(self) -> [ULimb; 12]
pub const fn to_le_limbs(self) -> [ULimb; 12]
Returns the memory representation of this as a series of limbs in little-endian byte order.
The value of each limb stays the same, however, the order that each is stored within the buffer is in little-endian order.
Sourcepub const fn to_ne_limbs(self) -> [ULimb; 12]
pub const fn to_ne_limbs(self) -> [ULimb; 12]
Returns the memory representation of this as a series of limbs.
As the target platform’s native endianness is used, portable code
should use to_be_limbs or to_le_limbs, as appropriate,
instead.
Sourcepub const fn from_be_limbs(limbs: [ULimb; 12]) -> Self
pub const fn from_be_limbs(limbs: [ULimb; 12]) -> Self
Creates a native endian integer value from its representation as limbs in big endian.
The value of each limb stays the same, however, the order that each is stored within the buffer as if it was from big-endian order.
Sourcepub const fn from_le_limbs(limbs: [ULimb; 12]) -> Self
pub const fn from_le_limbs(limbs: [ULimb; 12]) -> Self
Creates a native endian integer value from its representation as limbs in little endian.
The value of each limb stays the same, however, the order that each is stored within the buffer as if it was from little-endian order.
Sourcepub const fn from_ne_limbs(limbs: [ULimb; 12]) -> Self
pub const fn from_ne_limbs(limbs: [ULimb; 12]) -> Self
Creates a native endian integer value from its memory representation as limbs in native endianness.
As the target platform’s native endianness is used, portable code
likely wants to use from_be_limbs or from_le_limbs, as
appropriate instead.
Sourcepub const fn to_be_wide(self) -> [UWide; 6]
pub const fn to_be_wide(self) -> [UWide; 6]
Returns the memory representation of this as a series of wide in big-endian (network) byte order.
Sourcepub const fn to_le_wide(self) -> [UWide; 6]
pub const fn to_le_wide(self) -> [UWide; 6]
Returns the memory representation of this as a series of wide in little-endian byte order.
Sourcepub const fn to_ne_wide(self) -> [UWide; 6]
pub const fn to_ne_wide(self) -> [UWide; 6]
Returns the memory representation of this as a series of wide types.
As the target platform’s native endianness is used, portable code
should use to_be_wide or to_le_wide, as appropriate,
instead.
Sourcepub const fn from_be_wide(wide: [UWide; 6]) -> Self
pub const fn from_be_wide(wide: [UWide; 6]) -> Self
Creates a native endian integer value from its representation as a wide type in big endian.
Sourcepub const fn from_le_wide(wide: [UWide; 6]) -> Self
pub const fn from_le_wide(wide: [UWide; 6]) -> Self
Creates a native endian integer value from its representation as a wide type in little endian.
Sourcepub const fn from_ne_wide(wide: [UWide; 6]) -> Self
pub const fn from_ne_wide(wide: [UWide; 6]) -> Self
Creates a native endian integer value from its memory representation as a wide type in native endianness.
As the target platform’s native endianness is used, portable code
likely wants to use from_be_wide or from_le_wide, as
appropriate instead.
Sourcepub const fn to_be_u32(self) -> [u32; 12]
pub const fn to_be_u32(self) -> [u32; 12]
Returns the memory representation of this as a series of u32 digits
in big-endian order.
Sourcepub const fn to_le_u32(self) -> [u32; 12]
pub const fn to_le_u32(self) -> [u32; 12]
Returns the memory representation of this as a series of u32 digits
in litte-endian order.
Sourcepub const fn from_be_u32(value: [u32; 12]) -> Self
pub const fn from_be_u32(value: [u32; 12]) -> Self
Creates a native endian integer value from its representation
as u32 elements in big-endian.
Sourcepub const fn from_le_u32(value: [u32; 12]) -> Self
pub const fn from_le_u32(value: [u32; 12]) -> Self
Creates a native endian integer value from its representation
as u32 elements in little-endian.
Sourcepub const fn from_ne_u32(value: [u32; 12]) -> Self
pub const fn from_ne_u32(value: [u32; 12]) -> Self
Creates a native endian integer value from its memory representation
as u32 in native endianness.
As the target platform’s native endianness is used, portable code
likely wants to use from_be_u32 or from_le_u32, as
appropriate instead.
Sourcepub const fn to_be_u64(self) -> [u64; 6]
pub const fn to_be_u64(self) -> [u64; 6]
Returns the memory representation of this as a series of u64 digits
in big-endian order.
Sourcepub const fn to_le_u64(self) -> [u64; 6]
pub const fn to_le_u64(self) -> [u64; 6]
Returns the memory representation of this as a series of u64 digits
in litte-endian order.
Sourcepub const fn from_be_u64(value: [u64; 6]) -> Self
pub const fn from_be_u64(value: [u64; 6]) -> Self
Creates a native endian integer value from its representation
as u64 elements in big-endian.
Sourcepub const fn from_le_u64(value: [u64; 6]) -> Self
pub const fn from_le_u64(value: [u64; 6]) -> Self
Creates a native endian integer value from its representation
as u64 elements in little-endian.
Sourcepub const fn from_ne_u64(value: [u64; 6]) -> Self
pub const fn from_ne_u64(value: [u64; 6]) -> Self
Creates a native endian integer value from its memory representation
as u64 in native endianness.
As the target platform’s native endianness is used, portable code
likely wants to use from_be_u64 or from_le_u64, as
appropriate instead.
Sourcepub const fn eq_branched(self, rhs: Self) -> bool
pub const fn eq_branched(self, rhs: Self) -> bool
Short-circuiting const implementation of Eq.
Sourcepub const fn eq_const(self, rhs: Self) -> bool
pub const fn eq_const(self, rhs: Self) -> bool
Non-short circuiting const implementation of Eq.
Sourcepub const fn lt_const(self, rhs: Self) -> bool
pub const fn lt_const(self, rhs: Self) -> bool
Non-short circuiting const implementation of PartialOrd::lt.
Sourcepub const fn le_const(self, rhs: Self) -> bool
pub const fn le_const(self, rhs: Self) -> bool
Non-short circuiting const implementation of PartialOrd::le.
Sourcepub const fn gt_const(self, rhs: Self) -> bool
pub const fn gt_const(self, rhs: Self) -> bool
Non-short circuiting const implementation of PartialOrd::gt.
Sourcepub const fn ge_const(self, rhs: Self) -> bool
pub const fn ge_const(self, rhs: Self) -> bool
Non-short circuiting const implementation of PartialOrd::ge.
Sourcepub const fn cmp_const(self, rhs: Self) -> Ordering
pub const fn cmp_const(self, rhs: Self) -> Ordering
Non-short circuiting const implementation of PartialOrd::cmp.
Sourcepub const fn from_u8(value: u8) -> Self
pub const fn from_u8(value: u8) -> Self
Create the 384-bit signed integer from a u8, as if by an as cast.
Sourcepub const fn from_u16(value: u16) -> Self
pub const fn from_u16(value: u16) -> Self
Create the 384-bit signed integer from a u16, as if by an as cast.
Sourcepub const fn from_u32(value: u32) -> Self
pub const fn from_u32(value: u32) -> Self
Create the 384-bit signed integer from a u32, as if by an as cast.
Sourcepub const fn from_u64(value: u64) -> Self
pub const fn from_u64(value: u64) -> Self
Create the 384-bit signed integer from a u64, as if by an as cast.
Sourcepub const fn from_u128(value: u128) -> Self
pub const fn from_u128(value: u128) -> Self
Create the 384-bit signed integer from a u128, as if by an as cast.
Sourcepub const fn from_ulimb(value: ULimb) -> Self
pub const fn from_ulimb(value: ULimb) -> Self
Create the 384-bit signed integer from an unsigned limb, as if by an as cast.
Sourcepub const fn from_uwide(value: UWide) -> Self
pub const fn from_uwide(value: UWide) -> Self
Create the 384-bit signed integer from an unsigned wide type, as if by an as cast.
Sourcepub const fn from_unsigned(value: U384) -> Self
pub const fn from_unsigned(value: U384) -> Self
Create the 384-bit signed integer from an unsigned integer, as if by an as cast.
Sourcepub const fn from_signed(value: Self) -> Self
pub const fn from_signed(value: Self) -> Self
Create the 384-bit signed integer from a signed integer, as if by an as cast.
Sourcepub const fn from_i8(value: i8) -> Self
pub const fn from_i8(value: i8) -> Self
Create the 384-bit signed integer from an i8, as if by an as cast.
Sourcepub const fn from_i16(value: i16) -> Self
pub const fn from_i16(value: i16) -> Self
Create the 384-bit signed integer from an i16, as if by an as cast.
Sourcepub const fn from_i32(value: i32) -> Self
pub const fn from_i32(value: i32) -> Self
Create the 384-bit signed integer from an i32, as if by an as cast.
Sourcepub const fn from_i64(value: i64) -> Self
pub const fn from_i64(value: i64) -> Self
Create the 384-bit signed integer from an i64, as if by an as cast.
Sourcepub const fn from_i128(value: i128) -> Self
pub const fn from_i128(value: i128) -> Self
Create the 256-bit unsigned integer from an i128, as if by an as
cast.
Sourcepub const fn from_ilimb(value: ILimb) -> Self
pub const fn from_ilimb(value: ILimb) -> Self
Create the 384-bit signed integer from a signed limb, as if by an as cast.
Sourcepub const fn from_iwide(value: IWide) -> Self
pub const fn from_iwide(value: IWide) -> Self
Create the 384-bit signed integer from a wide type, as if by an as cast.
Sourcepub const fn as_ulimb(&self) -> ULimb
pub const fn as_ulimb(&self) -> ULimb
Convert the 384-bit signed an unsigned limb, as if by an as cast.
Sourcepub const fn as_uwide(&self) -> UWide
pub const fn as_uwide(&self) -> UWide
Convert the 384-bit signed an unsigned wide type, as if by an as cast.
Sourcepub const fn as_ilimb(&self) -> ILimb
pub const fn as_ilimb(&self) -> ILimb
Convert the 384-bit signed a signed limb, as if by an as cast.
Sourcepub const fn as_iwide(&self) -> IWide
pub const fn as_iwide(&self) -> IWide
Convert the 384-bit signed a signed wide type, as if by an as cast.
Sourcepub const fn as_unsigned(&self) -> U384
pub const fn as_unsigned(&self) -> U384
Convert the 384-bit signed unsigned integer to the unsigned type, as if by an as cast.
Sourcepub const fn as_signed(&self) -> Self
pub const fn as_signed(&self) -> Self
Convert the 384-bit signed unsigned integer to the signed type, as if by an as cast.
Sourcepub const fn cast_unsigned(self) -> U384
pub const fn cast_unsigned(self) -> U384
Returns the bit pattern of self reinterpreted as an unsigned integer
of the same size.
This produces the same result as an as cast, but ensures that the
bit-width remains the same.
See i128::cast_unsigned.
Sourcepub const fn get_limb(&self, index: usize) -> ULimb
pub const fn get_limb(&self, index: usize) -> ULimb
Get the limb indexing from the least-significant order.
Sourcepub const fn get_wide(&self, index: usize) -> UWide
pub const fn get_wide(&self, index: usize) -> UWide
Get the wide value indexing from the least-significant order.
This optimizes extremely well, if the index is known ahead of time
into 2 mov instructions, that is, as efficient as can be.
Sourcepub const fn least_significant_limb(&self) -> ULimb
pub const fn least_significant_limb(&self) -> ULimb
Get the least significant limb in the buiffer.
Sourcepub const fn most_significant_limb(&self) -> ILimb
pub const fn most_significant_limb(&self) -> ILimb
Get the most significant limb in the buiffer.
Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Returns true if self is positive and false if the number is zero
or negative.
See i128::is_positive.
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Returns true if self is negative and false if the number is zero
or positive.
See i128::is_negative.
Sourcepub const fn pow(self, exp: u32) -> Self
pub const fn pow(self, exp: u32) -> Self
Raises self to the power of exp, using exponentiation by squaring.
See i128::pow.
Sourcepub fn div_rem(self, n: Self) -> (Self, Self)
pub fn div_rem(self, n: Self) -> (Self, Self)
Get the quotient and remainder of our big integer division.
This allows storing of both the quotient and remainder without making repeated calls.
§Panics
This panics if the divisor is 0.
Sourcepub const fn unsigned_abs(self) -> U384
pub const fn unsigned_abs(self) -> U384
Computes the absolute value of self without any wrapping
or panicking.
See i128::unsigned_abs.
Sourcepub fn div_euclid(self, rhs: Self) -> Self
pub fn div_euclid(self, rhs: Self) -> Self
Calculates the quotient of Euclidean division of self by rhs.
This computes the integer q such that self = q * rhs + r, with
r = self.rem_euclid(rhs) and 0 <= r < abs(rhs).
In other words, the result is self / rhs rounded to the integer q
such that self >= q * rhs.
If self > 0, this is equal to rounding towards zero (the default in
Rust); if self < 0, this is equal to rounding away from zero
(towards +/- infinity). If rhs > 0, this is equal to rounding
towards -infinity; if rhs < 0, this is equal to rounding towards
+infinity.
§Panics
This function will panic if rhs is zero or if self is Self::MIN
and rhs is -1. This behavior is not affected by the overflow-checks
flag.
See i128::div_euclid.
Sourcepub fn rem_euclid(self, rhs: Self) -> Self
pub fn rem_euclid(self, rhs: Self) -> Self
Calculates the least nonnegative remainder of self (mod rhs).
This is done as if by the Euclidean division algorithm – given
r = self.rem_euclid(rhs), the result satisfies
self = rhs * self.div_euclid(rhs) + r and 0 <= r < abs(rhs).
§Panics
This function will panic if rhs is zero or if self is Self::MIN
and rhs is -1. This behavior is not affected by the
overflow-checks flag.
See i128::rem_euclid.
Sourcepub fn div_floor(self, rhs: Self) -> Self
pub fn div_floor(self, rhs: Self) -> Self
Calculates the quotient of self and rhs, rounding the result towards
negative infinity.
§Panics
This function will panic if rhs is zero or if self is Self::MIN
and rhs is -1. This behavior is not affected by the overflow-checks
flag.
See i128::div_floor.
Sourcepub fn div_ceil(self, rhs: Self) -> Self
pub fn div_ceil(self, rhs: Self) -> Self
Calculates the quotient of self and rhs, rounding the result towards
positive infinity.
§Panics
This function will panic if rhs is zero or if self is Self::MIN
and rhs is -1. This behavior is not affected by the overflow-checks
flag.
See i128::div_ceil.
Sourcepub fn next_multiple_of(self, rhs: Self) -> Self
pub fn next_multiple_of(self, rhs: Self) -> Self
If rhs is positive, calculates the smallest value greater than or
equal to self that is a multiple of rhs. If rhs is negative,
calculates the largest value less than or equal to self that is a
multiple of rhs.
§Panics
This function will panic if rhs is zero.
§Overflow behavior
On overflow, this function will panic if overflow checks are enabled (default in debug mode) and wrap if overflow checks are disabled (default in release mode).
Sourcepub fn ilog(self, base: Self) -> u32
pub fn ilog(self, base: Self) -> u32
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
This method might not be optimized owing to implementation details;
ilog2 can produce results more efficiently for base 2, and ilog10
can produce results more efficiently for base 10.
§Panics
This function will panic if self is less than or equal to zero,
or if base is less than 2.
See i128::ilog.
Sourcepub const fn ilog2(self) -> u32
pub const fn ilog2(self) -> u32
Returns the base 2 logarithm of the number, rounded down.
§Panics
This function will panic if self is less than or equal to zero.
See i128::ilog2.
Sourcepub const fn abs_diff(self, other: Self) -> U384
pub const fn abs_diff(self, other: Self) -> U384
Computes the absolute difference between self and other.
This function always returns the correct answer without overflow or panics by returning an unsigned integer.
See i128::abs_diff.
Sourcepub const fn signum(self) -> Self
pub const fn signum(self) -> Self
Returns a number representing sign of self.
0if the number is zero1if the number is positive-1if the number is negative
See i128::signum.
Sourcepub const fn midpoint(self, rhs: Self) -> Self
pub const fn midpoint(self, rhs: Self) -> Self
Calculates the middle point of self and rhs.
midpoint(a, b) is (a + b) / 2 as if it were performed in a
sufficiently-large unsigned integral type. This implies that the
result is always rounded towards negative infinity and that no
overflow will ever occur.
See i128::midpoint.
Sourcepub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)
pub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)
Calculates self + rhs + carry and returns a tuple containing
the sum and the output carry.
Performs “ternary addition” of two integer operands and a carry-in bit, and returns an output integer and a carry-out bit. This allows chaining together multiple additions to create a wider addition, and can be useful for bignum addition.
See i128::carrying_add.
Sourcepub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)
pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)
Calculates self − rhs − borrow and returns a tuple
containing the difference and the output borrow.
Performs “ternary subtraction” by subtracting both an integer
operand and a borrow-in bit from self, and returns an output
integer and a borrow-out bit. This allows chaining together multiple
subtractions to create a wider subtraction, and can be useful for
bignum subtraction.
See i128::borrowing_sub.
Sourcepub const fn wrapping_pow(self, exp: u32) -> Self
pub const fn wrapping_pow(self, exp: u32) -> Self
Wrapping (modular) exponentiation. Computes self.pow(exp),
wrapping around at the boundary of the type.
See i128::wrapping_pow.
Sourcepub const fn wrapping_add(self, rhs: Self) -> Self
pub const fn wrapping_add(self, rhs: Self) -> Self
Wrapping (modular) addition. Computes self + rhs, wrapping around at
the boundary of the type.
See i128::wrapping_add.
Sourcepub const fn wrapping_sub(self, rhs: Self) -> Self
pub const fn wrapping_sub(self, rhs: Self) -> Self
Wrapping (modular) subtraction. Computes self - rhs, wrapping around
at the boundary of the type.
See i128::wrapping_sub.
Sourcepub const fn wrapping_sub_unsigned(self, rhs: U384) -> Self
pub const fn wrapping_sub_unsigned(self, rhs: U384) -> Self
Wrapping (modular) subtraction with an unsigned integer. Computes
self - rhs, wrapping around at the boundary of the type.
Sourcepub const fn wrapping_mul(self, rhs: Self) -> Self
pub const fn wrapping_mul(self, rhs: Self) -> Self
Wrapping (modular) multiplication. Computes self * rhs, wrapping
around at the boundary of the type.
This in worst case 10 mul and 13 add instructions, because of
branching in nearly every case, it has better performance and
optimizes nicely for small multiplications. See u256::wrapping_mul
for a more detailed analysis, which is identical.
See i128::wrapping_mul.
Sourcepub fn wrapping_div_rem(self, n: Self) -> (Self, Self)
pub fn wrapping_div_rem(self, n: Self) -> (Self, Self)
Div/Rem operation on the integer.
This allows storing of both the quotient and remainder without making repeated calls.
§Panics
This panics if the divisor is 0.
Sourcepub fn wrapping_div(self, rhs: Self) -> Self
pub fn wrapping_div(self, rhs: Self) -> Self
Wrapping (modular) division. Computes self / rhs, wrapping around at
the boundary of the type.
The only case where such wrapping can occur is when one divides MIN / -1 on a signed type (where MIN is the negative minimal value for
the type); this is equivalent to -MIN, a positive value
that is too large to represent in the type. In such a case, this
function returns MIN itself.
§Panics
This function will panic if rhs is zero.
See i128::wrapping_div.
Sourcepub fn wrapping_div_euclid(self, rhs: Self) -> Self
pub fn wrapping_div_euclid(self, rhs: Self) -> Self
Wrapping Euclidean division. Computes self.div_euclid(rhs),
wrapping around at the boundary of the type.
Wrapping will only occur in MIN / -1 on a signed type (where MIN is
the negative minimal value for the type). This is equivalent to
-MIN, a positive value that is too large to represent in the type.
In this case, this method returns MIN itself.
§Panics
This function will panic if rhs is zero.
Sourcepub fn wrapping_rem(self, rhs: Self) -> Self
pub fn wrapping_rem(self, rhs: Self) -> Self
Wrapping (modular) remainder. Computes self % rhs, wrapping around at
the boundary of the type.
Such wrap-around never actually occurs mathematically; implementation
artifacts make x % y invalid for MIN / -1 on a signed type
(where MIN is the negative minimal value). In such a case,
this function returns 0.
§Panics
This function will panic if rhs is zero.
See i128::wrapping_rem.
Sourcepub fn wrapping_rem_euclid(self, rhs: Self) -> Self
pub fn wrapping_rem_euclid(self, rhs: Self) -> Self
Wrapping Euclidean remainder. Computes self.rem_euclid(rhs), wrapping
around at the boundary of the type.
Wrapping will only occur in MIN % -1 on a signed type (where MIN is
the negative minimal value for the type). In this case, this method
returns 0.
Sourcepub const fn wrapping_neg(self) -> Self
pub const fn wrapping_neg(self) -> Self
Wrapping (modular) negation. Computes -self, wrapping around at the
boundary of the type.
The only case where such wrapping can occur is when one negates MIN on
a signed type (where MIN is the negative minimal value for the
type); this is a positive value that is too large to represent
in the type. In such a case, this function returns MIN itself.
See i128::wrapping_neg.
Sourcepub const fn wrapping_abs(self) -> Self
pub const fn wrapping_abs(self) -> Self
Wrapping (modular) absolute value. Computes self.abs(), wrapping
around at the boundary of the type.
The only case where such wrapping can occur is when one takes the
absolute value of the negative minimal value for the type; this is a
positive value that is too large to represent in the type. In such a
case, this function returns MIN itself.
See i128::wrapping_abs.
Sourcepub const fn overflowing_pow(self, exp: u32) -> (Self, bool)
pub const fn overflowing_pow(self, exp: u32) -> (Self, bool)
Raises self to the power of exp, using exponentiation by squaring,
returning the value.
Returns a tuple of the exponentiation along with a bool indicating whether an overflow happened.
Sourcepub fn overflowing_div_rem(self, n: Self) -> ((Self, Self), bool)
pub fn overflowing_div_rem(self, n: Self) -> ((Self, Self), bool)
Get the quotient and remainder of our big integer division, returning the value and if overflow occurred.
This allows storing of both the quotient and remainder without making repeated calls.
§Panics
This function will panic if rhs is zero.
Sourcepub const fn overflowing_add(self, rhs: Self) -> (Self, bool)
pub const fn overflowing_add(self, rhs: Self) -> (Self, bool)
Calculates self + rhs.
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
Sourcepub const fn overflowing_sub(self, rhs: Self) -> (Self, bool)
pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool)
Calculates self - rhs.
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
Sourcepub const fn overflowing_add_unsigned(self, rhs: U384) -> (Self, bool)
pub const fn overflowing_add_unsigned(self, rhs: U384) -> (Self, bool)
Calculates self + rhs with an unsigned rhs.
Returns a tuple of the addition along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
Sourcepub const fn overflowing_sub_unsigned(self, rhs: U384) -> (Self, bool)
pub const fn overflowing_sub_unsigned(self, rhs: U384) -> (Self, bool)
Calculates self - rhs with an unsigned rhs.
Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
Sourcepub const fn overflowing_mul(self, rhs: Self) -> (Self, bool)
pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool)
Calculates the multiplication of self and rhs.
Returns a tuple of the multiplication along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would have occurred then the wrapped value is returned.
This in worst case 10 mul, 20 add, and 9 sub instructions,
significantly slower than the wrapping variant.
Sourcepub fn overflowing_div(self, rhs: Self) -> (Self, bool)
pub fn overflowing_div(self, rhs: Self) -> (Self, bool)
Calculates the divisor when self is divided by rhs.
Returns a tuple of the divisor along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then self is returned.
§Panics
This function will panic if rhs is zero.
Sourcepub fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)
pub fn overflowing_div_euclid(self, rhs: Self) -> (Self, bool)
Calculates the quotient of Euclidean division self.div_euclid(rhs).
Returns a tuple of the divisor along with a boolean indicating whether
an arithmetic overflow would occur. If an overflow would occur then
self is returned.
§Panics
This function will panic if rhs is zero.
Sourcepub fn overflowing_rem(self, rhs: Self) -> (Self, bool)
pub fn overflowing_rem(self, rhs: Self) -> (Self, bool)
Calculates the remainder when self is divided by rhs.
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
§Panics
This function will panic if rhs is zero.
Sourcepub fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool)
pub fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool)
Overflowing Euclidean remainder. Calculates self.rem_euclid(rhs).
Returns a tuple of the remainder after dividing along with a boolean indicating whether an arithmetic overflow would occur. If an overflow would occur then 0 is returned.
§Panics
This function will panic if rhs is zero.
Sourcepub const fn overflowing_neg(self) -> (Self, bool)
pub const fn overflowing_neg(self) -> (Self, bool)
Negates self, overflowing if this is equal to the minimum value.
Returns a tuple of the negated version of self along with a boolean
indicating whether an overflow happened. If self is the minimum
value (e.g., i32::MIN for values of type i32), then the
minimum value will be returned again and true will be returned for an
overflow happening.
Sourcepub const fn overflowing_shl(self, rhs: u32) -> (Self, bool)
pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool)
Shifts self left by rhs bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
Sourcepub const fn overflowing_shr(self, rhs: u32) -> (Self, bool)
pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool)
Shifts self right by rhs bits.
Returns a tuple of the shifted version of self along with a boolean indicating whether the shift value was larger than or equal to the number of bits. If the shift value is too large, then value is masked (N-1) where N is the number of bits, and this value is then used to perform the shift.
Sourcepub const fn overflowing_abs(self) -> (Self, bool)
pub const fn overflowing_abs(self) -> (Self, bool)
Computes the absolute value of self.
Returns a tuple of the absolute version of self along with a boolean indicating whether an overflow happened.
Sourcepub const fn saturating_add(self, rhs: Self) -> Self
pub const fn saturating_add(self, rhs: Self) -> Self
Saturating integer addition. Computes self + rhs, saturating at the
numeric bounds instead of overflowing.
See i128::saturating_add.
Sourcepub const fn saturating_add_unsigned(self, rhs: U384) -> Self
pub const fn saturating_add_unsigned(self, rhs: U384) -> Self
Saturating addition with an unsigned integer. Computes self + rhs,
saturating at the numeric bounds instead of overflowing.
Sourcepub const fn saturating_sub(self, rhs: Self) -> Self
pub const fn saturating_sub(self, rhs: Self) -> Self
Saturating integer subtraction. Computes self - rhs, saturating at the
numeric bounds instead of overflowing.
See i128::saturating_sub.
Sourcepub const fn saturating_sub_unsigned(self, rhs: U384) -> Self
pub const fn saturating_sub_unsigned(self, rhs: U384) -> Self
Saturating subtraction with an unsigned integer. Computes self - rhs,
saturating at the numeric bounds instead of overflowing.
Sourcepub const fn saturating_neg(self) -> Self
pub const fn saturating_neg(self) -> Self
Saturating integer negation. Computes -self, returning MAX if self == MIN instead of overflowing.
See i128::saturating_neg.
Sourcepub const fn saturating_abs(self) -> Self
pub const fn saturating_abs(self) -> Self
Saturating absolute value. Computes self.abs(), returning MAX if
self == MIN instead of overflowing.
See i128::saturating_abs.
Sourcepub const fn saturating_mul(self, rhs: Self) -> Self
pub const fn saturating_mul(self, rhs: Self) -> Self
Saturating integer multiplication. Computes self * rhs, saturating at
the numeric bounds instead of overflowing.
See i128::saturating_mul.
Sourcepub fn saturating_div(self, rhs: Self) -> Self
pub fn saturating_div(self, rhs: Self) -> Self
Saturating integer division. Computes self / rhs, saturating at the
numeric bounds instead of overflowing.
§Panics
This function will panic if rhs is zero.
See i128::saturating_div.
Sourcepub const fn saturating_pow(self, exp: u32) -> Self
pub const fn saturating_pow(self, exp: u32) -> Self
Saturating integer exponentiation. Computes self.pow(exp),
saturating at the numeric bounds instead of overflowing.
See i128::saturating_pow.
Sourcepub const fn checked_add(self, rhs: Self) -> Option<Self>
pub const fn checked_add(self, rhs: Self) -> Option<Self>
Checked integer addition. Computes self + rhs, returning None
if overflow occurred.
See i128::checked_add.
Sourcepub const fn checked_sub(self, rhs: Self) -> Option<Self>
pub const fn checked_sub(self, rhs: Self) -> Option<Self>
Checked integer subtraction. Computes self - rhs, returning None
if overflow occurred.
See i128::checked_sub.
Sourcepub const fn checked_mul(self, rhs: Self) -> Option<Self>
pub const fn checked_mul(self, rhs: Self) -> Option<Self>
Checked integer multiplication. Computes self * rhs, returning None
if overflow occurred.
See i128::checked_mul.
Sourcepub const fn checked_pow(self, base: u32) -> Option<Self>
pub const fn checked_pow(self, base: u32) -> Option<Self>
Checked exponentiation. Computes self.pow(exp), returning None
if overflow occurred.
See i128::checked_pow.
Sourcepub fn checked_div_rem(self, n: Self) -> Option<(Self, Self)>
pub fn checked_div_rem(self, n: Self) -> Option<(Self, Self)>
Checked integer division. Computes self / rhs, returning None
rhs == 0 or the division results in overflow (signed only).
This allows storing of both the quotient and remainder without making repeated calls.
Sourcepub fn checked_div(self, rhs: Self) -> Option<Self>
pub fn checked_div(self, rhs: Self) -> Option<Self>
Checked integer division. Computes self / rhs, returning None
rhs == 0 or the division results in overflow (signed only).
See i128::checked_div.
Sourcepub fn checked_rem(self, rhs: Self) -> Option<Self>
pub fn checked_rem(self, rhs: Self) -> Option<Self>
Checked integer division. Computes self % rhs, returning None
rhs == 0 or the division results in overflow (signed only).
See i128::checked_rem.
Sourcepub fn checked_div_euclid(self, rhs: Self) -> Option<Self>
pub fn checked_div_euclid(self, rhs: Self) -> Option<Self>
Checked Euclidean division. Computes self.div_euclid(rhs),
returning None if rhs == 0 or the division results in
overflow (signed only).
Sourcepub fn checked_rem_euclid(self, rhs: Self) -> Option<Self>
pub fn checked_rem_euclid(self, rhs: Self) -> Option<Self>
Checked Euclidean modulo. Computes self.rem_euclid(rhs),
returning None if rhs == 0 or the division results in
overflow (signed only).
Sourcepub const fn checked_shl(self, rhs: u32) -> Option<Self>
pub const fn checked_shl(self, rhs: u32) -> Option<Self>
Checked shift left. Computes self << rhs, returning None if rhs is
larger than or equal to the number of bits in self.
See i128::checked_shl.
Sourcepub const fn checked_shr(self, rhs: u32) -> Option<Self>
pub const fn checked_shr(self, rhs: u32) -> Option<Self>
Checked shift right. Computes self >> rhs, returning None if rhs
is larger than or equal to the number of bits in self.
See i128::checked_shr.
Sourcepub const fn checked_ilog2(self) -> Option<u32>
pub const fn checked_ilog2(self) -> Option<u32>
Returns the base 2 logarithm of the number, rounded down.
Returns None if the number is negative or zero.
See i128::checked_ilog2.
Sourcepub const fn checked_add_unsigned(self, rhs: U384) -> Option<Self>
pub const fn checked_add_unsigned(self, rhs: U384) -> Option<Self>
Checked addition with an unsigned integer. Computes self + rhs,
returning None if overflow occurred.
Sourcepub const fn checked_sub_unsigned(self, rhs: U384) -> Option<Self>
pub const fn checked_sub_unsigned(self, rhs: U384) -> Option<Self>
Checked subtraction with an unsigned integer. Computes self - rhs,
returning None if overflow occurred.
Sourcepub const fn checked_neg(self) -> Option<Self>
pub const fn checked_neg(self) -> Option<Self>
Checked negation. Computes -self, returning None if self == MIN.
See i128::checked_neg.
Sourcepub const fn checked_abs(self) -> Option<Self>
pub const fn checked_abs(self) -> Option<Self>
Checked absolute value. Computes self.abs(), returning None if
self == MIN.
See i128::checked_abs.
Sourcepub fn checked_ilog(self, base: Self) -> Option<u32>
pub fn checked_ilog(self, base: Self) -> Option<u32>
Returns the logarithm of the number with respect to an arbitrary base, rounded down.
Returns None if the number is negative or zero, or if the base is not
at least 2.
This method might not be optimized owing to implementation details;
checked_ilog2 can produce results more efficiently for base 2, and
checked_ilog10 can produce results more efficiently for base 10.
See i128::checked_ilog.
Sourcepub fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>
pub fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>
If rhs is positive, calculates the smallest value greater than or
equal to self that is a multiple of rhs. If rhs is negative,
calculates the largest value less than or equal to self that is a
multiple of rhs. Returns None if rhs is zero or the operation
would result in overflow.
Sourcepub const fn strict_add(self, rhs: Self) -> Self
pub const fn strict_add(self, rhs: Self) -> Self
Strict integer addition. Computes self + rhs, panicking
if overflow occurred.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_add.
Sourcepub const fn strict_sub(self, rhs: Self) -> Self
pub const fn strict_sub(self, rhs: Self) -> Self
Strict integer subtraction. Computes self - rhs, panicking if
overflow occurred.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_sub.
Sourcepub const fn strict_mul(self, rhs: Self) -> Self
pub const fn strict_mul(self, rhs: Self) -> Self
Strict integer multiplication. Computes self * rhs, panicking if
overflow occurred.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_mul.
Sourcepub const fn strict_pow(self, rhs: u32) -> Self
pub const fn strict_pow(self, rhs: u32) -> Self
Strict exponentiation. Computes self.pow(exp), panicking if
overflow occurred.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_pow.
Sourcepub const fn strict_shl(self, rhs: u32) -> Self
pub const fn strict_shl(self, rhs: u32) -> Self
Strict shift left. Computes self << rhs, panicking if rhs is larger
than or equal to the number of bits in self.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_shl.
Sourcepub const fn strict_shr(self, rhs: u32) -> Self
pub const fn strict_shr(self, rhs: u32) -> Self
Strict shift right. Computes self >> rhs, panicking rhs is
larger than or equal to the number of bits in self.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_shr.
Sourcepub const fn strict_add_unsigned(self, rhs: U384) -> Self
pub const fn strict_add_unsigned(self, rhs: U384) -> Self
Strict addition with an unsigned integer. Computes self + rhs,
panicking if overflow occurred.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_add_unsigned.
Sourcepub const fn strict_sub_unsigned(self, rhs: U384) -> Self
pub const fn strict_sub_unsigned(self, rhs: U384) -> Self
Strict subtraction with an unsigned integer. Computes self - rhs,
panicking if overflow occurred.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_sub_unsigned.
Sourcepub fn strict_div(self, rhs: Self) -> Self
pub fn strict_div(self, rhs: Self) -> Self
Strict integer division. Computes self / rhs, panicking
if overflow occurred.
§Panics
This function will panic if rhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur is when one divides MIN / -1 on a signed type (where MIN is the negative minimal value
for the type.
See i128::strict_div.
Sourcepub fn strict_rem(self, rhs: Self) -> Self
pub fn strict_rem(self, rhs: Self) -> Self
Strict integer remainder. Computes self % rhs, panicking if
the division results in overflow.
§Panics
This function will panic if rhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur is x % y for MIN / -1
on a signed type (where MIN is the negative minimal value), which
is invalid due to implementation artifacts.
See i128::strict_rem.
Sourcepub fn strict_div_euclid(self, rhs: Self) -> Self
pub fn strict_div_euclid(self, rhs: Self) -> Self
Strict Euclidean division. Computes self.div_euclid(rhs), panicking
if overflow occurred.
§Panics
This function will panic if rhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur is when one divides MIN / -1 on a signed type (where MIN is the negative minimal value
for the type); this is equivalent to -MIN, a positive value
that is too large to represent in the type.
Sourcepub fn strict_rem_euclid(self, rhs: Self) -> Self
pub fn strict_rem_euclid(self, rhs: Self) -> Self
Strict Euclidean remainder. Computes self.rem_euclid(rhs), panicking
if the division results in overflow.
§Panics
This function will panic if rhs is zero.
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
The only case where such an overflow can occur is x % y for MIN / -1
on a signed type (where MIN is the negative minimal value), which
is invalid due to implementation artifacts.
Sourcepub const fn strict_neg(self) -> Self
pub const fn strict_neg(self) -> Self
Strict negation. Computes -self, panicking if self == MIN.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_neg.
Sourcepub const fn strict_abs(self) -> Self
pub const fn strict_abs(self) -> Self
Strict absolute value. Computes self.abs(), panicking if
self == MIN.
§Panics
§Overflow behavior
This function will always panic on overflow, regardless of whether overflow checks are enabled.
See i128::strict_abs.
Sourcepub unsafe fn unchecked_neg(self) -> Self
pub unsafe fn unchecked_neg(self) -> Self
Unchecked negation. Computes -self, assuming overflow cannot occur.
§Safety
This results in undefined behavior when the value overflows.
See i128::unchecked_neg.
Sourcepub unsafe fn unchecked_add(self, rhs: Self) -> Self
pub unsafe fn unchecked_add(self, rhs: Self) -> Self
Unchecked integer addition. Computes self + rhs, assuming overflow
cannot occur.
Calling x.unchecked_add(y) is semantically equivalent to calling
x.checked_add(y).unwrap_unchecked().
If you’re just trying to avoid the panic in debug mode, then do not
use this. Instead, you’re looking for wrapping_add.
This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
§Safety
This results in undefined behavior when the value overflows.
See i128::unchecked_add.
Sourcepub unsafe fn unchecked_sub(self, rhs: Self) -> Self
pub unsafe fn unchecked_sub(self, rhs: Self) -> Self
Unchecked integer subtraction. Computes self - rhs, assuming overflow
cannot occur.
Calling x.unchecked_sub(y) is semantically equivalent to calling
x.checked_sub(y).unwrap_unchecked().
If you’re just trying to avoid the panic in debug mode, then do not
use this. Instead, you’re looking for wrapping_sub.
This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
§Safety
This results in undefined behavior when the value overflows.
See i128::unchecked_sub.
Sourcepub const unsafe fn unchecked_mul(self, rhs: Self) -> Self
pub const unsafe fn unchecked_mul(self, rhs: Self) -> Self
Unchecked integer multiplication. Computes self * rhs, assuming
overflow cannot occur.
Calling x.unchecked_mul(y) is semantically equivalent to calling
x.checked_mul(y).unwrap_unchecked().
If you’re just trying to avoid the panic in debug mode, then do not
use this. Instead, you’re looking for wrapping_mul.
This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
§Safety
This results in undefined behavior when the value overflows.
See i128::unchecked_mul.
Sourcepub const unsafe fn unchecked_shl(self, rhs: u32) -> Self
pub const unsafe fn unchecked_shl(self, rhs: u32) -> Self
Unchecked shift left. Computes self << rhs, assuming that
rhs is less than the number of bits in self.
This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
§Safety
This results in undefined behavior if rhs is larger than
or equal to the number of bits in self,
i.e. when checked_shl would return None.
See i128::unchecked_shl.
Sourcepub const unsafe fn unchecked_shr(self, rhs: u32) -> Self
pub const unsafe fn unchecked_shr(self, rhs: u32) -> Self
Unchecked shift right. Computes self >> rhs, assuming that
rhs is less than the number of bits in self.
This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
§Safety
This results in undefined behavior if rhs is larger than
or equal to the number of bits in self,
i.e. when checked_shr would return None.
See i128::unchecked_shr.
Sourcepub const fn unbounded_shl(self, rhs: u32) -> Self
pub const fn unbounded_shl(self, rhs: u32) -> Self
Unbounded shift left. Computes self << rhs, without bounding the value
of rhs.
If rhs is larger or equal to the number of bits in self,
the entire value is shifted out, and 0 is returned.
Sourcepub const fn unbounded_shr(self, rhs: u32) -> Self
pub const fn unbounded_shr(self, rhs: u32) -> Self
Unbounded shift right. Computes self >> rhs, without bounding the
value of rhs.
If rhs is larger or equal to the number of bits in self,
the entire value is shifted out, and 0 is returned.
Sourcepub const fn add_ulimb(self, n: ULimb) -> Self
pub const fn add_ulimb(self, n: ULimb) -> Self
Add an unsigned limb to the big integer.
This allows optimizations a full addition cannot do.
Sourcepub const fn sub_ulimb(self, n: ULimb) -> Self
pub const fn sub_ulimb(self, n: ULimb) -> Self
Subtract an unsigned limb from the big integer.
This allows optimizations a full subtraction cannot do.
Sourcepub const fn mul_ulimb(self, n: ULimb) -> Self
pub const fn mul_ulimb(self, n: ULimb) -> Self
Multiply our big integer by an unsigned limb.
This allows optimizations a full multiplication cannot do.
Sourcepub fn div_rem_ulimb(self, n: ULimb) -> (Self, ULimb)
pub fn div_rem_ulimb(self, n: ULimb) -> (Self, ULimb)
Get the quotient and remainder of our big integer divided by an unsigned limb.
This allows optimizations a full division cannot do.
§Panics
This panics if the divisor is 0.
Sourcepub fn div_ulimb(self, n: ULimb) -> Self
pub fn div_ulimb(self, n: ULimb) -> Self
Get the quotient of our big integer divided by an unsigned limb.
This allows optimizations a full division cannot do.
Sourcepub fn rem_ulimb(self, n: ULimb) -> ULimb
pub fn rem_ulimb(self, n: ULimb) -> ULimb
Get the remainder of our big integer divided by an unsigned limb.
This allows optimizations a full division cannot do.
Sourcepub const fn add_ilimb(self, n: ILimb) -> Self
pub const fn add_ilimb(self, n: ILimb) -> Self
Add a signed limb to the big integer.
This allows optimizations a full addition cannot do.
Sourcepub const fn sub_ilimb(self, n: ILimb) -> Self
pub const fn sub_ilimb(self, n: ILimb) -> Self
Subtract a signed limb from the big integer.
This allows optimizations a full subtraction cannot do.
Sourcepub const fn mul_ilimb(self, n: ILimb) -> Self
pub const fn mul_ilimb(self, n: ILimb) -> Self
Multiply our big integer by a signed limb.
This allows optimizations a full multiplication cannot do.
Sourcepub fn div_rem_ilimb(self, n: ILimb) -> (Self, ILimb)
pub fn div_rem_ilimb(self, n: ILimb) -> (Self, ILimb)
Get the quotient and remainder of our big integer divided by a signed limb.
This allows optimizations a full division cannot do.
Sourcepub fn div_ilimb(self, n: ILimb) -> Self
pub fn div_ilimb(self, n: ILimb) -> Self
Get the quotient of our big integer divided by a signed limb.
This allows optimizations a full division cannot do.
Sourcepub fn rem_ilimb(self, n: ILimb) -> ILimb
pub fn rem_ilimb(self, n: ILimb) -> ILimb
Get the remainder of our big integer divided by a signed limb.
This allows optimizations a full division cannot do.
Sourcepub fn wrapping_div_ulimb(self, n: ULimb) -> Self
pub fn wrapping_div_ulimb(self, n: ULimb) -> Self
Get the quotient of our big integer divided by an unsigned limb, wrapping on overflow.
This allows optimizations a full division cannot do.
Sourcepub fn wrapping_rem_ulimb(self, n: ULimb) -> ULimb
pub fn wrapping_rem_ulimb(self, n: ULimb) -> ULimb
Get the remainder of our big integer divided by an unsigned limb, wrapping on overflow.
This allows optimizations a full division cannot do.
Sourcepub const fn wrapping_add_ulimb(self, n: ULimb) -> Self
pub const fn wrapping_add_ulimb(self, n: ULimb) -> Self
Add an unsigned limb to the big integer, wrapping on overflow.
This allows optimizations a full addition cannot do.
Sourcepub const fn wrapping_add_ilimb(self, n: ILimb) -> Self
pub const fn wrapping_add_ilimb(self, n: ILimb) -> Self
Add a signed limb to the big integer, wrapping on overflow.
This allows optimizations a full addition cannot do.
Sourcepub const fn wrapping_sub_ulimb(self, n: ULimb) -> Self
pub const fn wrapping_sub_ulimb(self, n: ULimb) -> Self
Subtract an unsigned limb from the big integer, wrapping on overflow.
This allows optimizations a full subtraction cannot do.
Sourcepub const fn wrapping_sub_ilimb(self, n: ILimb) -> Self
pub const fn wrapping_sub_ilimb(self, n: ILimb) -> Self
Subtract a signed limb from the big integer, wrapping on overflow.
This allows optimizations a full subtraction cannot do.
Sourcepub const fn wrapping_mul_ulimb(self, n: ULimb) -> Self
pub const fn wrapping_mul_ulimb(self, n: ULimb) -> Self
Multiply our big integer by an unsigned limb, wrapping on overflow.
This allows optimizations a full multiplication cannot do.
This in worst case 5 mul, 3 add, and 6 sub instructions,
because of branching in nearly every case, it has better
performance and optimizes nicely for small multiplications.
See u256::wrapping_mul_ulimb for a more detailed analysis,
which is identical.
Sourcepub const fn wrapping_mul_ilimb(self, n: ILimb) -> Self
pub const fn wrapping_mul_ilimb(self, n: ILimb) -> Self
Multiply our big integer by a signed limb, wrapping on overflow.
This allows optimizations a full multiplication cannot do.
This in worst case 4 mul, 3 add, and 6 sub instructions,
because of branching in nearly every case, it has better
performance and optimizes nicely for small multiplications.
Sourcepub fn wrapping_div_rem_ulimb(self, n: ULimb) -> (Self, ULimb)
pub fn wrapping_div_rem_ulimb(self, n: ULimb) -> (Self, ULimb)
Get the quotient and remainder of our big integer divided by an unsigned limb, wrapping on overflow.
This allows optimizations a full division cannot do. This always wraps, which can never happen in practice. This has to use the floor division since we can never have a non-negative rem.
Sourcepub fn wrapping_div_rem_ilimb(self, n: ILimb) -> (Self, ILimb)
pub fn wrapping_div_rem_ilimb(self, n: ILimb) -> (Self, ILimb)
Get the quotient and remainder of our big integer divided by a signed limb, wrapping on overflow.
This allows optimizations a full division cannot do. This always wraps, which can never happen in practice.
Sourcepub fn wrapping_div_ilimb(self, n: ILimb) -> Self
pub fn wrapping_div_ilimb(self, n: ILimb) -> Self
Get the quotient of our big integer divided by a signed limb, wrapping on overflow.
This allows optimizations a full division cannot do.
Sourcepub fn wrapping_rem_ilimb(self, n: ILimb) -> ILimb
pub fn wrapping_rem_ilimb(self, n: ILimb) -> ILimb
Get the remainder of our big integer divided by a signed limb, wrapping on overflow.
This allows optimizations a full division cannot do.
Sourcepub fn overflowing_div_rem_ulimb(self, n: ULimb) -> ((Self, ULimb), bool)
pub fn overflowing_div_rem_ulimb(self, n: ULimb) -> ((Self, ULimb), bool)
Get the quotient and remainder of our big integer divided by an unsigned limb, returning the value and if overflow occurred.
This allows optimizations a full division cannot do.
Sourcepub fn overflowing_div_ulimb(self, n: ULimb) -> (Self, bool)
pub fn overflowing_div_ulimb(self, n: ULimb) -> (Self, bool)
Get the quotient of our big integer divided by an unsigned limb, returning the value and if overflow occurred.
This allows optimizations a full division cannot do.
Sourcepub fn overflowing_rem_ulimb(self, n: ULimb) -> (ULimb, bool)
pub fn overflowing_rem_ulimb(self, n: ULimb) -> (ULimb, bool)
Get the remainder of our big integer divided by an unsigned limb, returning the value and if overflow occurred.
This allows optimizations a full division cannot do.
Sourcepub const fn overflowing_add_ulimb(self, n: ULimb) -> (Self, bool)
pub const fn overflowing_add_ulimb(self, n: ULimb) -> (Self, bool)
Add an unsigned limb to the big integer, returning the value and if overflow occurred.
This allows optimizations a full addition cannot do.
Sourcepub const fn overflowing_add_ilimb(self, n: ILimb) -> (Self, bool)
pub const fn overflowing_add_ilimb(self, n: ILimb) -> (Self, bool)
Add a signed limb to the big integer, returning the value and if overflow occurred.
This allows optimizations a full addition cannot do.
Sourcepub const fn overflowing_sub_ulimb(self, n: ULimb) -> (Self, bool)
pub const fn overflowing_sub_ulimb(self, n: ULimb) -> (Self, bool)
Subtract an unsigned limb from the big integer, returning the value and if overflow occurred.
This allows optimizations a full subtraction cannot do.
Sourcepub const fn overflowing_sub_ilimb(self, n: ILimb) -> (Self, bool)
pub const fn overflowing_sub_ilimb(self, n: ILimb) -> (Self, bool)
Subtract a signed limb from the big integer, returning the value and if overflow occurred.
This allows optimizations a full subtraction cannot do.
Sourcepub const fn overflowing_mul_ulimb(self, n: ULimb) -> (Self, bool)
pub const fn overflowing_mul_ulimb(self, n: ULimb) -> (Self, bool)
Multiply our big integer by an unsigned limb, returning the value and if overflow occurred.
This allows optimizations a full multiplication cannot do.
This in worst case 4 mul, 4 add, and 6 sub instructions,
significantly slower than the wrapping variant.
Sourcepub const fn overflowing_mul_ilimb(self, n: ILimb) -> (Self, bool)
pub const fn overflowing_mul_ilimb(self, n: ILimb) -> (Self, bool)
Multiply our big integer by a signed limb, returning the value and if overflow occurred.
This allows optimizations a full multiplication cannot do.
This in worst case 5 mul, 5 add, and 6 sub instructions,
significantly slower than the wrapping variant.
Sourcepub fn overflowing_div_rem_ilimb(self, n: ILimb) -> ((Self, ILimb), bool)
pub fn overflowing_div_rem_ilimb(self, n: ILimb) -> ((Self, ILimb), bool)
Get the quotient and remainder of our big integer divided by a signed limb, returning the value and if overflow occurred.
This allows optimizations a full division cannot do.
Sourcepub fn overflowing_div_ilimb(self, n: ILimb) -> (Self, bool)
pub fn overflowing_div_ilimb(self, n: ILimb) -> (Self, bool)
Get the quotient of our big integer divided by a signed limb, returning the value and if overflow occurred.
This allows optimizations a full division cannot do.
Sourcepub fn overflowing_rem_ilimb(self, n: ILimb) -> (ILimb, bool)
pub fn overflowing_rem_ilimb(self, n: ILimb) -> (ILimb, bool)
Get the remainder of our big integer divided by a signed limb, returning the value and if overflow occurred.
This allows optimizations a full division cannot do.
Sourcepub const fn checked_add_ulimb(self, n: ULimb) -> Option<Self>
pub const fn checked_add_ulimb(self, n: ULimb) -> Option<Self>
Add an unsigned limb to the big integer, returning None on overflow.
This allows optimizations a full addition cannot do.
Sourcepub const fn checked_sub_ulimb(self, n: ULimb) -> Option<Self>
pub const fn checked_sub_ulimb(self, n: ULimb) -> Option<Self>
Subtract an unsigned limb from the big integer, returning None on overflow.
This allows optimizations a full addition cannot do.
Sourcepub const fn checked_mul_ulimb(self, n: ULimb) -> Option<Self>
pub const fn checked_mul_ulimb(self, n: ULimb) -> Option<Self>
Multiply our big integer by an unsigned limb, returning None on overflow.
This allows optimizations a full multiplication cannot do.
Sourcepub fn checked_div_rem_ulimb(self, n: ULimb) -> Option<(Self, ULimb)>
pub fn checked_div_rem_ulimb(self, n: ULimb) -> Option<(Self, ULimb)>
Get the quotient of our big integer divided by an unsigned limb, returning None on overflow or division by 0.
This allows optimizations a full division cannot do.
Sourcepub fn checked_div_ulimb(self, n: ULimb) -> Option<Self>
pub fn checked_div_ulimb(self, n: ULimb) -> Option<Self>
Get the quotient of our big integer divided by an unsigned limb, returning None on overflow or division by 0.
This allows optimizations a full division cannot do.
Sourcepub fn checked_rem_ulimb(self, n: ULimb) -> Option<ULimb>
pub fn checked_rem_ulimb(self, n: ULimb) -> Option<ULimb>
Get the remainder of our big integer divided by a signed limb, returning None on overflow or division by 0.
This allows optimizations a full division cannot do.
Sourcepub const fn checked_add_ilimb(self, n: ILimb) -> Option<Self>
pub const fn checked_add_ilimb(self, n: ILimb) -> Option<Self>
Add a signed limb to the big integer, returning None on overflow.
This allows optimizations a full addition cannot do.
Sourcepub const fn checked_sub_ilimb(self, n: ILimb) -> Option<Self>
pub const fn checked_sub_ilimb(self, n: ILimb) -> Option<Self>
Subtract a signed limb from the big integer, returning None on overflow.
This allows optimizations a full subtraction cannot do.
Sourcepub const fn checked_mul_ilimb(self, n: ILimb) -> Option<Self>
pub const fn checked_mul_ilimb(self, n: ILimb) -> Option<Self>
Multiply our big integer by a signed limb, returning None on overflow.
This allows optimizations a full multiplication cannot do.
Sourcepub fn checked_div_rem_ilimb(self, n: ILimb) -> Option<(Self, ILimb)>
pub fn checked_div_rem_ilimb(self, n: ILimb) -> Option<(Self, ILimb)>
Get the quotient and remainder of our big integer divided by a signed limb, returning None on overflow or division by 0.
This allows optimizations a full division cannot do.
Sourcepub fn checked_div_ilimb(self, n: ILimb) -> Option<Self>
pub fn checked_div_ilimb(self, n: ILimb) -> Option<Self>
Get the quotient of our big integer divided by a signed limb, returning None on overflow or division by 0.
This allows optimizations a full division cannot do.
Sourcepub fn checked_rem_ilimb(self, n: ILimb) -> Option<ILimb>
pub fn checked_rem_ilimb(self, n: ILimb) -> Option<ILimb>
Get the remainder of our big integer divided by a signed limb, returning None on overflow or division by 0.
This allows optimizations a full division cannot do.
Sourcepub const fn from_str_radix(
src: &str,
radix: u32,
) -> Result<Self, ParseIntError>
pub const fn from_str_radix( src: &str, radix: u32, ) -> Result<Self, ParseIntError>
Converts a string slice in a given base to an integer.
The string is expected to be an optional +
sign followed by only digits. Leading and trailing non-digit characters
(including whitespace) represent an error. Underscores (which are
accepted in rust literals) also represent an error.
Digits are a subset of these characters, depending on radix:
0-9a-zA-Z
This only has rudimentary optimizations.
§Panics
This function panics if radix is not in the range from 2 to 36.
Sourcepub fn to_str_radix(self, buffer: &mut [u8], radix: u32) -> &[u8] ⓘ
pub fn to_str_radix(self, buffer: &mut [u8], radix: u32) -> &[u8] ⓘ
Write the integer to bytes for the given integer.
Digits are a subset of these characters, depending on radix:
0-9a-zA-Z
This only has rudimentary optimizations.
§Panics
This function panics if radix is not in the range from 2 to 36,
or the buffer isn’t large enough to hold the significant digits.
Trait Implementations§
Source§impl AddAssign<&I384> for I384
impl AddAssign<&I384> for I384
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
+= operation. Read moreSource§impl AddAssign for I384
impl AddAssign for I384
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
+= operation. Read moreSource§impl BitAndAssign<&I384> for I384
impl BitAndAssign<&I384> for I384
Source§fn bitand_assign(&mut self, other: &Self)
fn bitand_assign(&mut self, other: &Self)
&= operation. Read moreSource§impl BitAndAssign for I384
impl BitAndAssign for I384
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
&= operation. Read moreSource§impl BitOrAssign<&I384> for I384
impl BitOrAssign<&I384> for I384
Source§fn bitor_assign(&mut self, other: &Self)
fn bitor_assign(&mut self, other: &Self)
|= operation. Read moreSource§impl BitOrAssign for I384
impl BitOrAssign for I384
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read moreSource§impl BitXorAssign<&I384> for I384
impl BitXorAssign<&I384> for I384
Source§fn bitxor_assign(&mut self, other: &Self)
fn bitxor_assign(&mut self, other: &Self)
^= operation. Read moreSource§impl BitXorAssign for I384
impl BitXorAssign for I384
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
^= operation. Read moreSource§impl DivAssign<&I384> for I384
impl DivAssign<&I384> for I384
Source§fn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
/= operation. Read moreSource§impl DivAssign for I384
impl DivAssign for I384
Source§fn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
/= operation. Read moreSource§impl FromStr for I384
impl FromStr for I384
Source§fn from_str(src: &str) -> Result<Self, ParseIntError>
fn from_str(src: &str) -> Result<Self, ParseIntError>
Parses a string s to return a value of this type.
This is not optimized, since all optimization is done in theimplementation.
Source§type Err = ParseIntError
type Err = ParseIntError
Source§impl MulAssign<&I384> for I384
impl MulAssign<&I384> for I384
Source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
*= operation. Read moreSource§impl MulAssign for I384
impl MulAssign for I384
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
*= operation. Read moreSource§impl Ord for I384
impl Ord for I384
Source§impl PartialOrd for I384
impl PartialOrd for I384
Source§impl RemAssign<&I384> for I384
impl RemAssign<&I384> for I384
Source§fn rem_assign(&mut self, other: &Self)
fn rem_assign(&mut self, other: &Self)
%= operation. Read moreSource§impl RemAssign for I384
impl RemAssign for I384
Source§fn rem_assign(&mut self, other: Self)
fn rem_assign(&mut self, other: Self)
%= operation. Read moreSource§impl ShlAssign<&I384> for U384
impl ShlAssign<&I384> for U384
Source§fn shl_assign(&mut self, other: &I384)
fn shl_assign(&mut self, other: &I384)
<<= operation. Read moreSource§impl ShlAssign<&U384> for I384
impl ShlAssign<&U384> for I384
Source§fn shl_assign(&mut self, other: &U384)
fn shl_assign(&mut self, other: &U384)
<<= operation. Read moreSource§impl ShlAssign<&i128> for I384
impl ShlAssign<&i128> for I384
Source§fn shl_assign(&mut self, other: &i128)
fn shl_assign(&mut self, other: &i128)
<<= operation. Read moreSource§impl ShlAssign<&i16> for I384
impl ShlAssign<&i16> for I384
Source§fn shl_assign(&mut self, other: &i16)
fn shl_assign(&mut self, other: &i16)
<<= operation. Read moreSource§impl ShlAssign<&i32> for I384
impl ShlAssign<&i32> for I384
Source§fn shl_assign(&mut self, other: &i32)
fn shl_assign(&mut self, other: &i32)
<<= operation. Read moreSource§impl ShlAssign<&i64> for I384
impl ShlAssign<&i64> for I384
Source§fn shl_assign(&mut self, other: &i64)
fn shl_assign(&mut self, other: &i64)
<<= operation. Read moreSource§impl ShlAssign<&i8> for I384
impl ShlAssign<&i8> for I384
Source§fn shl_assign(&mut self, other: &i8)
fn shl_assign(&mut self, other: &i8)
<<= operation. Read moreSource§impl ShlAssign<&isize> for I384
impl ShlAssign<&isize> for I384
Source§fn shl_assign(&mut self, other: &isize)
fn shl_assign(&mut self, other: &isize)
<<= operation. Read moreSource§impl ShlAssign<&u128> for I384
impl ShlAssign<&u128> for I384
Source§fn shl_assign(&mut self, other: &u128)
fn shl_assign(&mut self, other: &u128)
<<= operation. Read moreSource§impl ShlAssign<&u16> for I384
impl ShlAssign<&u16> for I384
Source§fn shl_assign(&mut self, other: &u16)
fn shl_assign(&mut self, other: &u16)
<<= operation. Read moreSource§impl ShlAssign<&u32> for I384
impl ShlAssign<&u32> for I384
Source§fn shl_assign(&mut self, other: &u32)
fn shl_assign(&mut self, other: &u32)
<<= operation. Read moreSource§impl ShlAssign<&u64> for I384
impl ShlAssign<&u64> for I384
Source§fn shl_assign(&mut self, other: &u64)
fn shl_assign(&mut self, other: &u64)
<<= operation. Read moreSource§impl ShlAssign<&u8> for I384
impl ShlAssign<&u8> for I384
Source§fn shl_assign(&mut self, other: &u8)
fn shl_assign(&mut self, other: &u8)
<<= operation. Read moreSource§impl ShlAssign<&usize> for I384
impl ShlAssign<&usize> for I384
Source§fn shl_assign(&mut self, other: &usize)
fn shl_assign(&mut self, other: &usize)
<<= operation. Read moreSource§impl ShlAssign<I384> for U384
impl ShlAssign<I384> for U384
Source§fn shl_assign(&mut self, other: I384)
fn shl_assign(&mut self, other: I384)
<<= operation. Read moreSource§impl ShlAssign<U384> for I384
impl ShlAssign<U384> for I384
Source§fn shl_assign(&mut self, other: U384)
fn shl_assign(&mut self, other: U384)
<<= operation. Read moreSource§impl ShlAssign<i128> for I384
impl ShlAssign<i128> for I384
Source§fn shl_assign(&mut self, other: i128)
fn shl_assign(&mut self, other: i128)
<<= operation. Read moreSource§impl ShlAssign<i16> for I384
impl ShlAssign<i16> for I384
Source§fn shl_assign(&mut self, other: i16)
fn shl_assign(&mut self, other: i16)
<<= operation. Read moreSource§impl ShlAssign<i32> for I384
impl ShlAssign<i32> for I384
Source§fn shl_assign(&mut self, other: i32)
fn shl_assign(&mut self, other: i32)
<<= operation. Read moreSource§impl ShlAssign<i64> for I384
impl ShlAssign<i64> for I384
Source§fn shl_assign(&mut self, other: i64)
fn shl_assign(&mut self, other: i64)
<<= operation. Read moreSource§impl ShlAssign<i8> for I384
impl ShlAssign<i8> for I384
Source§fn shl_assign(&mut self, other: i8)
fn shl_assign(&mut self, other: i8)
<<= operation. Read moreSource§impl ShlAssign<isize> for I384
impl ShlAssign<isize> for I384
Source§fn shl_assign(&mut self, other: isize)
fn shl_assign(&mut self, other: isize)
<<= operation. Read moreSource§impl ShlAssign<u128> for I384
impl ShlAssign<u128> for I384
Source§fn shl_assign(&mut self, other: u128)
fn shl_assign(&mut self, other: u128)
<<= operation. Read moreSource§impl ShlAssign<u16> for I384
impl ShlAssign<u16> for I384
Source§fn shl_assign(&mut self, other: u16)
fn shl_assign(&mut self, other: u16)
<<= operation. Read moreSource§impl ShlAssign<u32> for I384
impl ShlAssign<u32> for I384
Source§fn shl_assign(&mut self, other: u32)
fn shl_assign(&mut self, other: u32)
<<= operation. Read moreSource§impl ShlAssign<u64> for I384
impl ShlAssign<u64> for I384
Source§fn shl_assign(&mut self, other: u64)
fn shl_assign(&mut self, other: u64)
<<= operation. Read moreSource§impl ShlAssign<u8> for I384
impl ShlAssign<u8> for I384
Source§fn shl_assign(&mut self, other: u8)
fn shl_assign(&mut self, other: u8)
<<= operation. Read moreSource§impl ShlAssign<usize> for I384
impl ShlAssign<usize> for I384
Source§fn shl_assign(&mut self, other: usize)
fn shl_assign(&mut self, other: usize)
<<= operation. Read moreSource§impl ShrAssign<&I384> for U384
impl ShrAssign<&I384> for U384
Source§fn shr_assign(&mut self, other: &I384)
fn shr_assign(&mut self, other: &I384)
>>= operation. Read moreSource§impl ShrAssign<&U384> for I384
impl ShrAssign<&U384> for I384
Source§fn shr_assign(&mut self, other: &U384)
fn shr_assign(&mut self, other: &U384)
>>= operation. Read moreSource§impl ShrAssign<&i128> for I384
impl ShrAssign<&i128> for I384
Source§fn shr_assign(&mut self, other: &i128)
fn shr_assign(&mut self, other: &i128)
>>= operation. Read moreSource§impl ShrAssign<&i16> for I384
impl ShrAssign<&i16> for I384
Source§fn shr_assign(&mut self, other: &i16)
fn shr_assign(&mut self, other: &i16)
>>= operation. Read moreSource§impl ShrAssign<&i32> for I384
impl ShrAssign<&i32> for I384
Source§fn shr_assign(&mut self, other: &i32)
fn shr_assign(&mut self, other: &i32)
>>= operation. Read moreSource§impl ShrAssign<&i64> for I384
impl ShrAssign<&i64> for I384
Source§fn shr_assign(&mut self, other: &i64)
fn shr_assign(&mut self, other: &i64)
>>= operation. Read moreSource§impl ShrAssign<&i8> for I384
impl ShrAssign<&i8> for I384
Source§fn shr_assign(&mut self, other: &i8)
fn shr_assign(&mut self, other: &i8)
>>= operation. Read moreSource§impl ShrAssign<&isize> for I384
impl ShrAssign<&isize> for I384
Source§fn shr_assign(&mut self, other: &isize)
fn shr_assign(&mut self, other: &isize)
>>= operation. Read moreSource§impl ShrAssign<&u128> for I384
impl ShrAssign<&u128> for I384
Source§fn shr_assign(&mut self, other: &u128)
fn shr_assign(&mut self, other: &u128)
>>= operation. Read moreSource§impl ShrAssign<&u16> for I384
impl ShrAssign<&u16> for I384
Source§fn shr_assign(&mut self, other: &u16)
fn shr_assign(&mut self, other: &u16)
>>= operation. Read moreSource§impl ShrAssign<&u32> for I384
impl ShrAssign<&u32> for I384
Source§fn shr_assign(&mut self, other: &u32)
fn shr_assign(&mut self, other: &u32)
>>= operation. Read moreSource§impl ShrAssign<&u64> for I384
impl ShrAssign<&u64> for I384
Source§fn shr_assign(&mut self, other: &u64)
fn shr_assign(&mut self, other: &u64)
>>= operation. Read moreSource§impl ShrAssign<&u8> for I384
impl ShrAssign<&u8> for I384
Source§fn shr_assign(&mut self, other: &u8)
fn shr_assign(&mut self, other: &u8)
>>= operation. Read moreSource§impl ShrAssign<&usize> for I384
impl ShrAssign<&usize> for I384
Source§fn shr_assign(&mut self, other: &usize)
fn shr_assign(&mut self, other: &usize)
>>= operation. Read moreSource§impl ShrAssign<I384> for U384
impl ShrAssign<I384> for U384
Source§fn shr_assign(&mut self, other: I384)
fn shr_assign(&mut self, other: I384)
>>= operation. Read moreSource§impl ShrAssign<U384> for I384
impl ShrAssign<U384> for I384
Source§fn shr_assign(&mut self, other: U384)
fn shr_assign(&mut self, other: U384)
>>= operation. Read moreSource§impl ShrAssign<i128> for I384
impl ShrAssign<i128> for I384
Source§fn shr_assign(&mut self, other: i128)
fn shr_assign(&mut self, other: i128)
>>= operation. Read moreSource§impl ShrAssign<i16> for I384
impl ShrAssign<i16> for I384
Source§fn shr_assign(&mut self, other: i16)
fn shr_assign(&mut self, other: i16)
>>= operation. Read moreSource§impl ShrAssign<i32> for I384
impl ShrAssign<i32> for I384
Source§fn shr_assign(&mut self, other: i32)
fn shr_assign(&mut self, other: i32)
>>= operation. Read moreSource§impl ShrAssign<i64> for I384
impl ShrAssign<i64> for I384
Source§fn shr_assign(&mut self, other: i64)
fn shr_assign(&mut self, other: i64)
>>= operation. Read moreSource§impl ShrAssign<i8> for I384
impl ShrAssign<i8> for I384
Source§fn shr_assign(&mut self, other: i8)
fn shr_assign(&mut self, other: i8)
>>= operation. Read moreSource§impl ShrAssign<isize> for I384
impl ShrAssign<isize> for I384
Source§fn shr_assign(&mut self, other: isize)
fn shr_assign(&mut self, other: isize)
>>= operation. Read moreSource§impl ShrAssign<u128> for I384
impl ShrAssign<u128> for I384
Source§fn shr_assign(&mut self, other: u128)
fn shr_assign(&mut self, other: u128)
>>= operation. Read moreSource§impl ShrAssign<u16> for I384
impl ShrAssign<u16> for I384
Source§fn shr_assign(&mut self, other: u16)
fn shr_assign(&mut self, other: u16)
>>= operation. Read moreSource§impl ShrAssign<u32> for I384
impl ShrAssign<u32> for I384
Source§fn shr_assign(&mut self, other: u32)
fn shr_assign(&mut self, other: u32)
>>= operation. Read moreSource§impl ShrAssign<u64> for I384
impl ShrAssign<u64> for I384
Source§fn shr_assign(&mut self, other: u64)
fn shr_assign(&mut self, other: u64)
>>= operation. Read moreSource§impl ShrAssign<u8> for I384
impl ShrAssign<u8> for I384
Source§fn shr_assign(&mut self, other: u8)
fn shr_assign(&mut self, other: u8)
>>= operation. Read moreSource§impl ShrAssign<usize> for I384
impl ShrAssign<usize> for I384
Source§fn shr_assign(&mut self, other: usize)
fn shr_assign(&mut self, other: usize)
>>= operation. Read moreSource§impl SubAssign<&I384> for I384
impl SubAssign<&I384> for I384
Source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
-= operation. Read moreSource§impl SubAssign for I384
impl SubAssign for I384
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
-= operation. Read more