i256

Struct U384

Source
pub struct U384 { /* private fields */ }
Expand description

The 384-bit unsigned 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 U384

Source

pub const MIN: Self

The smallest value that can be represented by this integer type.

See u128::MIN.

Source

pub const MAX: Self

The largest value that can be represented by this integer type (2256 - 1).

See u128::MAX.

Source

pub const BITS: u32 = 384u32

The size of this integer type in bits.

§Examples
assert_eq!(u256::BITS, 256);

See u128::BITS.

Source

pub const IS_SIGNED: bool = false

If the integer is signed, that is, can contain negative numbers.

Source

pub const fn min_value() -> Self

👎Deprecated

New code should prefer to use u128::MIN instead.

Returns the smallest value that can be represented by this integer type.

See u128::min_value.

Source

pub const fn max_value() -> Self

👎Deprecated

New code should prefer to use u128::MAX instead.

Returns the largest value that can be represented by this integer type.

See u128::max_value.

Source

pub const fn count_ones(self) -> u32

Returns the number of ones in the binary representation of self.

See u128::count_ones.

Source

pub const fn count_zeros(self) -> u32

Returns the number of zeros in the binary representation of self.

See u128::count_zeros.

Source

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 u128::leading_zeros.

Source

pub const fn trailing_zeros(self) -> u32

Returns the number of trailing zeros in the binary representation of self.

See u128::trailing_zeros.

Source

pub const fn leading_ones(self) -> u32

Returns the number of leading ones in the binary representation of self.

See u128::leading_ones.

Source

pub const fn trailing_ones(self) -> u32

Returns the number of trailing ones in the binary representation of self.

See u128::trailing_ones.

Source

pub const fn bitand_const(self, rhs: Self) -> Self

Const implementation of BitAnd.

Source

pub const fn bitor_const(self, rhs: Self) -> Self

Const implementation of BitOr.

Source

pub const fn bitxor_const(self, rhs: Self) -> Self

Const implementation of BitXor.

Source

pub const fn not_const(self) -> Self

Const implementation of Not.

Source

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 u128::rotate_left.

Source

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 u128::rotate_right.

Source

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 u128::wrapping_shl.

Source

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 u128::wrapping_shr.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn to_ne_u32(self) -> [u32; 12]

Returns the memory representation of this as a series of u32.

As the target platform’s native endianness is used, portable code should use to_be_u32 or to_le_u32, as appropriate, instead.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub const fn to_ne_u64(self) -> [u64; 6]

Returns the memory representation of this as a series of u64.

As the target platform’s native endianness is used, portable code should use to_be_u64 or to_le_u64, as appropriate, instead.

Source

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.

Source

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.

Source

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.

Source

pub const fn eq_branched(self, rhs: Self) -> bool

Short-circuiting const implementation of Eq.

Source

pub const fn eq_const(self, rhs: Self) -> bool

Non-short circuiting const implementation of Eq.

Source

pub const fn lt_const(self, rhs: Self) -> bool

Non-short circuiting const implementation of PartialOrd::lt.

Source

pub const fn le_const(self, rhs: Self) -> bool

Non-short circuiting const implementation of PartialOrd::le.

Source

pub const fn gt_const(self, rhs: Self) -> bool

Non-short circuiting const implementation of PartialOrd::gt.

Source

pub const fn ge_const(self, rhs: Self) -> bool

Non-short circuiting const implementation of PartialOrd::ge.

Source

pub const fn cmp_const(self, rhs: Self) -> Ordering

Non-short circuiting const implementation of PartialOrd::cmp.

Source

pub const fn from_u8(value: u8) -> Self

Create the 384-bit unsigned integer from a u8, as if by an as cast.

Source

pub const fn from_u16(value: u16) -> Self

Create the 384-bit unsigned integer from a u16, as if by an as cast.

Source

pub const fn from_u32(value: u32) -> Self

Create the 384-bit unsigned integer from a u32, as if by an as cast.

Source

pub const fn from_u64(value: u64) -> Self

Create the 384-bit unsigned integer from a u64, as if by an as cast.

Source

pub const fn from_u128(value: u128) -> Self

Create the 384-bit unsigned integer from a u128, as if by an as cast.

Source

pub const fn from_ulimb(value: ULimb) -> Self

Create the 384-bit unsigned integer from an unsigned limb, as if by an as cast.

Source

pub const fn from_uwide(value: UWide) -> Self

Create the 384-bit unsigned integer from an unsigned wide type, as if by an as cast.

Source

pub const fn from_unsigned(value: Self) -> Self

Create the 384-bit unsigned integer from an unsigned integer, as if by an as cast.

Source

pub const fn from_signed(value: I384) -> Self

Create the 384-bit unsigned integer from a signed integer, as if by an as cast.

Source

pub const fn from_i8(value: i8) -> Self

Create the 384-bit unsigned integer from an i8, as if by an as cast.

Source

pub const fn from_i16(value: i16) -> Self

Create the 384-bit unsigned integer from an i16, as if by an as cast.

Source

pub const fn from_i32(value: i32) -> Self

Create the 384-bit unsigned integer from an i32, as if by an as cast.

Source

pub const fn from_i64(value: i64) -> Self

Create the 384-bit unsigned integer from an i64, as if by an as cast.

Source

pub const fn from_i128(value: i128) -> Self

Create the 256-bit unsigned integer from an i128, as if by an as cast.

Source

pub const fn from_ilimb(value: ILimb) -> Self

Create the 384-bit unsigned integer from a signed limb, as if by an as cast.

Source

pub const fn from_iwide(value: IWide) -> Self

Create the 384-bit unsigned integer from a wide type, as if by an as cast.

Source

pub const fn as_u8(&self) -> u8

Convert the 384-bit unsigned to a u8, as if by an as cast.

Source

pub const fn as_u16(&self) -> u16

Convert the 384-bit unsigned to a u16, as if by an as cast.

Source

pub const fn as_u32(&self) -> u32

Convert the 384-bit unsigned to a u32, as if by an as cast.

Source

pub const fn as_u64(&self) -> u64

Convert the 384-bit unsigned to a u64, as if by an as cast.

Source

pub const fn as_ulimb(&self) -> ULimb

Convert the 384-bit unsigned an unsigned limb, as if by an as cast.

Source

pub const fn as_u128(&self) -> u128

Convert the 384-bit unsigned to a u128, as if by an as cast.

Source

pub const fn as_uwide(&self) -> UWide

Convert the 384-bit unsigned an unsigned wide type, as if by an as cast.

Source

pub const fn as_i8(&self) -> i8

Convert the 384-bit unsigned to an i8, as if by an as cast.

Source

pub const fn as_i16(&self) -> i16

Convert the 384-bit unsigned to an i16, as if by an as cast.

Source

pub const fn as_i32(&self) -> i32

Convert the 384-bit unsigned to an i32, as if by an as cast.

Source

pub const fn as_i64(&self) -> i64

Convert the 384-bit unsigned to an i64, as if by an as cast.

Source

pub const fn as_i128(&self) -> i128

Convert the 384-bit unsigned to a i128, as if by an as cast.

Source

pub const fn as_ilimb(&self) -> ILimb

Convert the 384-bit unsigned a signed limb, as if by an as cast.

Source

pub const fn as_iwide(&self) -> IWide

Convert the 384-bit unsigned a signed wide type, as if by an as cast.

Source

pub const fn as_unsigned(&self) -> Self

Convert the 384-bit unsigned unsigned integer to the unsigned type, as if by an as cast.

Source

pub const fn as_signed(&self) -> I384

Convert the 384-bit unsigned unsigned integer to the signed type, as if by an as cast.

Source

pub const fn cast_signed(self) -> I384

Returns the bit pattern of self reinterpreted as a signed integer of the same size.

This produces the same result as an as cast, but ensures that the bit-width remains the same.

See u128::cast_signed.

Source

pub const fn is_even(&self) -> bool

Get if the integer is even.

Source

pub const fn is_odd(&self) -> bool

Get if the integer is odd.

Source

pub const fn get_limb(&self, index: usize) -> ULimb

Get the limb indexing from the least-significant order.

Source

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.

Source

pub const fn least_significant_limb(&self) -> ULimb

Get the least significant limb in the buiffer.

Source

pub const fn most_significant_limb(&self) -> ULimb

Get the most significant limb in the buiffer.

Source

pub const fn low(self) -> Self

Get the lower half of the integer, that is, the bits in [0, BITS/2).

Source

pub const fn high(self) -> Self

Get the upper half of the integer, that is, the bits in [BITS/2, BITS), shifted into place to the lower half.

Source

pub const fn high_mul(self, rhs: Self) -> Self

Multiply two values, grabbing the high half of the product.

Naively, this is Self::widening_mul and then taking the high half, however, this can use custom optimizations.

Source

pub const fn pow(self, exp: u32) -> Self

Raises self to the power of exp, using exponentiation by squaring.

See u128::pow.

Source

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.

Source

pub fn div_euclid(self, rhs: Self) -> Self

Performs Euclidean division.

Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self / rhs.

§Panics

This function will panic if rhs is zero.

See u128::div_euclid.

Source

pub fn rem_euclid(self, rhs: Self) -> Self

Calculates the least remainder of self (mod rhs).

Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self % rhs.

§Panics

This function will panic if rhs is zero.

See u128::rem_euclid.

Source

pub fn div_floor(self, rhs: Self) -> Self

Calculates the quotient of self and rhs, rounding the result towards negative infinity.

This is the same as performing self / rhs for all unsigned integers.

§Panics

This function will panic if rhs is zero.

See u128::div_floor.

Source

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.

See u128::div_ceil.

Source

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 zero, or if base is less than 2.

See u128::ilog.

Source

pub const fn ilog2(self) -> u32

Returns the base 2 logarithm of the number, rounded down.

§Panics

This function will panic if self is zero.

See u128::ilog2.

Source

pub const fn abs_diff(self, other: Self) -> Self

Computes the absolute difference between self and other.

See u128::abs_diff.

Source

pub fn next_multiple_of(self, rhs: Self) -> Self

Calculates the smallest value greater 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).

See u128::next_multiple_of.

Source

pub fn is_multiple_of(self, rhs: Self) -> bool

Returns true if self is an integer multiple of rhs, and false otherwise.

This function is equivalent to self % rhs == 0, except that it will not panic for rhs == 0. Instead, 0.is_multiple_of(0) == true, and for any non-zero n, n.is_multiple_of(0) == false.

Source

pub const fn is_power_of_two(self) -> bool

Returns true if and only if self == 2^k for some k.

See u128::is_power_of_two.

Source

pub const fn next_power_of_two(self) -> Self

Returns the smallest power of two greater than or equal to self.

When return value overflows (i.e., self > (1 << (N-1)) for type uN), it panics in debug mode and the return value is wrapped to 0 in release mode (the only situation in which this method can return 0).

See u128::next_power_of_two.

Source

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 zero and that no overflow will ever occur.

See u128::midpoint.

Source

pub const fn widening_mul(self, rhs: Self) -> (Self, Self)

Calculates the complete product self * rhs without the possibility to overflow.

This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.

If you also need to add a carry to the wide result, then you want Self::carrying_mul instead.

§Examples

Basic usage:

Please note that this example is shared between integer types. Which explains why u32 is used here.

#![feature(bigint_helper_methods)]
assert_eq!(5u32.widening_mul(2), (10, 0));
assert_eq!(1_000_000_000u32.widening_mul(10), (1410065408, 2));

See u64::widening_mul.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub const fn carrying_mul(self, rhs: Self, carry: Self) -> (Self, Self)

Calculates the “full multiplication” self * rhs + carry without the possibility to overflow.

This returns the low-order (wrapping) bits and the high-order (overflow) bits of the result as two separate values, in that order.

Performs “long multiplication” which takes in an extra amount to add, and may return an additional amount of overflow. This allows for chaining together multiple multiplications to create “big integers” which represent larger values.

If you don’t need the carry, then you can use Self::widening_mul instead.

Source

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 u128::carrying_add.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool)

Calculates selfrhsborrow 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 u128::borrowing_sub.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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 u128::wrapping_pow.

Source

pub const fn wrapping_add(self, rhs: Self) -> Self

Wrapping (modular) addition. Computes self + rhs, wrapping around at the boundary of the type.

See u128::wrapping_add.

Source

pub const fn wrapping_add_signed(self, rhs: I384) -> Self

Wrapping (modular) addition with a signed integer. Computes self + rhs, wrapping around at the boundary of the type.

See u128::wrapping_add_signed.

Source

pub const fn wrapping_sub(self, rhs: Self) -> Self

Wrapping (modular) subtraction. Computes self - rhs, wrapping around at the boundary of the type.

See u128::wrapping_sub.

Source

pub const fn wrapping_mul(self, rhs: Self) -> Self

Wrapping (modular) multiplication. Computes self * rhs, wrapping around at the boundary of the type.

Many different algorithms were attempted, with a soft mulx approach (1), a flat, fixed-width long multiplication (2), and a short-circuiting long multiplication (3). Algorithm (3) had the best performance for 128-bit multiplication, however, algorithm (1) was better for smaller type sizes.

This also optimized much better when multiplying by a single or a half-sized item: rather than using 4 limbs, if we’re multiplying (u128, u128) * u128, we can use 2 limbs for the right operand, and for (u128, u128) * u64, only

§Assembly

For a 128-bit multiplication (2x u64 + 2x u64), algorithm (1) had 6 mul, 6 add, and 6 bitshift instructions. Algorithm (3) had 10 mul, 12 add, and 12 bitshift instructions in the worst case, with a minimum of 4 mul and 2 add instructions, along with a lot of branching. That is, it was almost never worth it.

However, for 256-bit multiplication, the switch flips, with algorithm (1) having 10 mul and 14 add instructions. However, algorithm (3) has in the worst case 10 mul and 13 add instructions, however, because of branching in nearly every case, it has better performance and optimizes nicely for small multiplications.

See u128::wrapping_mul.

Source

pub fn wrapping_div_rem(self, n: Self) -> (Self, Self)

Get the quotient and remainder of our big integer divided by a signed limb, wrapping on overflow.

This allows storing of both the quotient and remainder without making repeated calls.

§Panics

This panics if the divisor is 0.

Source

pub fn wrapping_div(self, rhs: Self) -> Self

Wrapping (modular) division. Computes self / rhs.

Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists so that all operations are accounted for in the wrapping operations.

§Panics

This function will panic if rhs is zero.

See u128::wrapping_div.

Source

pub fn wrapping_div_euclid(self, rhs: Self) -> Self

Wrapping Euclidean division. Computes self.div_euclid(rhs).

Wrapped division on unsigned types is just normal division. There’s no way wrapping could ever happen. This function exists so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.wrapping_div(rhs).

§Panics

This function will panic if rhs is zero.

See u128::wrapping_div_euclid.

Source

pub fn wrapping_rem(self, rhs: Self) -> Self

Wrapping (modular) remainder. Computes self % rhs.

Wrapped remainder calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists so that all operations are accounted for in the wrapping operations.

§Panics

This function will panic if rhs is zero.

See u128::wrapping_rem.

Source

pub fn wrapping_rem_euclid(self, rhs: Self) -> Self

Wrapping Euclidean modulo. Computes self.rem_euclid(rhs).

Wrapped modulo calculation on unsigned types is just the regular remainder calculation. There’s no way wrapping could ever happen. This function exists so that all operations are accounted for in the wrapping operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.wrapping_rem(rhs).

§Panics

This function will panic if rhs is zero.

See u128::wrapping_rem_euclid.

Source

pub const fn wrapping_neg(self) -> Self

Wrapping (modular) negation. Computes -self, wrapping around at the boundary of the type.

Since unsigned types do not have negative equivalents all applications of this function will wrap (except for -0). For values smaller than the corresponding signed type’s maximum the result is the same as casting the corresponding signed value. Any larger values are equivalent to MAX + 1 - (val - MAX - 1) where MAX is the corresponding signed type’s maximum.

See u128::wrapping_neg.

Source

pub const fn wrapping_next_power_of_two(self) -> Self

Returns the smallest power of two greater than or equal to n. If the next power of two is greater than the type’s maximum value, the return value is wrapped to 0.

See u128::wrapping_next_power_of_two.

Source

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.

See u128::overflowing_pow.

Source

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.

Source

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.

See u128::overflowing_add.

Source

pub const fn overflowing_add_signed(self, rhs: I384) -> (Self, bool)

Calculates self + rhs with a signed 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.

See u128::overflowing_add_signed.

Source

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.

See u128::overflowing_sub.

Source

pub const fn overflowing_sub_signed(self, rhs: I384) -> (Self, bool)

Calculates self - rhs with a signed 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.

Source

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.

Many different algorithms were attempted, with a soft mulx approach (1), a flat, fixed-width long multiplication (2), and a short-circuiting long multiplication (3). Algorithm (3) had the best performance for 128-bit multiplication, however, algorithm (1) was better for smaller type sizes.

This also optimized much better when multiplying by a single or a half-sized item: rather than using 4 limbs, if we’re multiplying (u128, u128) * u128, we can use 2 limbs for the right operand, and for (u128, u128) * u64, only 1 limb.

§Assembly

The analysis here is practically identical to that of wrapping_mul.

See u128::overflowing_mul.

Source

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. Note that for unsigned integers overflow never occurs, so the second value is always false.

§Panics

This function will panic if rhs is zero.

See u128::overflowing_div.

Source

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. Note that for unsigned integers overflow never occurs, so the second value is always false. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.overflowing_div(rhs).

§Panics

This function will panic if rhs is zero.

See u128::overflowing_div_euclid.

Source

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. Note that for unsigned integers overflow never occurs, so the second value is always false.

§Panics

This function will panic if rhs is zero.

See u128::overflowing_rem.

Source

pub fn overflowing_rem_euclid(self, rhs: Self) -> (Self, bool)

Calculates the remainder self.rem_euclid(rhs) as if by Euclidean division.

Returns a tuple of the modulo after dividing along with a boolean indicating whether an arithmetic overflow would occur. Note that for unsigned integers overflow never occurs, so the second value is always false. Since, for the positive integers, all common definitions of division are equal, this operation is exactly equal to self.overflowing_rem(rhs).

§Panics

This function will panic if rhs is zero.

See u128::overflowing_rem_euclid.

Source

pub const fn saturating_add(self, rhs: Self) -> Self

Saturating integer addition. Computes self + rhs, saturating at the numeric bounds instead of overflowing. See u128::saturating_add.

Source

pub const fn saturating_add_signed(self, rhs: I384) -> Self

Saturating addition with a signed integer. Computes self + rhs, saturating at the numeric bounds instead of overflowing. See u128::saturating_add_signed.

Source

pub const fn saturating_sub(self, rhs: Self) -> Self

Saturating integer subtraction. Computes self - rhs, saturating at the numeric bounds instead of overflowing. See u128::saturating_sub.

Source

pub const fn saturating_mul(self, rhs: Self) -> Self

Saturating integer multiplication. Computes self * rhs, saturating at the numeric bounds instead of overflowing. See u128::saturating_mul.

Source

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 u128::saturating_div.

Source

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 u128::saturating_pow.

Source

pub const fn checked_add(self, rhs: Self) -> Option<Self>

Checked integer addition. Computes self + rhs, returning None if overflow occurred.

See u128::checked_add.

Source

pub const fn checked_sub(self, rhs: Self) -> Option<Self>

Checked integer subtraction. Computes self - rhs, returning None if overflow occurred.

See u128::checked_sub.

Source

pub const fn checked_mul(self, rhs: Self) -> Option<Self>

Checked integer multiplication. Computes self * rhs, returning None if overflow occurred.

See u128::checked_mul.

Source

pub const fn checked_pow(self, base: u32) -> Option<Self>

Checked exponentiation. Computes self.pow(exp), returning None if overflow occurred.

See u128::checked_pow.

Source

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.

Source

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 u128::checked_div.

Source

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 u128::checked_rem.

Source

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).

See u128::checked_div_euclid.

Source

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).

See u128::checked_rem_euclid.

Source

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 u128::checked_shl.

Source

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 u128::checked_shr.

Source

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 u128::checked_ilog2.

Source

pub const fn checked_add_signed(self, rhs: I384) -> Option<Self>

Checked addition with a signed integer. Computes self + rhs, returning None if overflow occurred. See u128::checked_add_signed.

Source

pub const fn checked_neg(self) -> Option<Self>

Checked negation. Computes -self, returning None unless self == 0.

Note that negating any positive integer will overflow. See u128::checked_neg.

Source

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 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 u128::checked_ilog.

Source

pub fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>

Calculates the smallest value greater than or equal to self that is a multiple of rhs. Returns None if rhs is zero or the operation would result in overflow. See u128::checked_next_multiple_of.

Source

pub const fn checked_signed_diff(self, rhs: Self) -> Option<I384>

Checked subtraction with a signed integer. Computes self - rhs, returning None if overflow occurred.

Source

pub const fn checked_next_power_of_two(self) -> Option<Self>

Returns the smallest power of two greater than or equal to self. If the next power of two is greater than the type’s maximum value, None is returned, otherwise the power of two is wrapped in Some. See u128::checked_next_power_of_two.

Source

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 u128::strict_add.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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 u128::strict_sub.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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 u128::strict_mul.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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 u128::strict_pow.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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 u128::strict_shl.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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 u128::strict_shr.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub const fn strict_add_signed(self, rhs: I384) -> Self

Strict addition with a signed 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 u128::strict_add_signed.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub fn strict_div(self, rhs: Self) -> Self

Strict integer division. Computes self / rhs.

Strict division on unsigned types is just normal division. There’s no way overflow could ever happen. This function exists so that all operations are accounted for in the strict operations.

§Panics

This function will panic if rhs is zero. See u128::strict_div.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub fn strict_rem(self, rhs: Self) -> Self

Strict integer remainder. Computes self % rhs.

Strict remainder calculation on unsigned types is just the regular remainder calculation. There’s no way overflow could ever happen. This function exists so that all operations are accounted for in the strict operations.

§Panics

This function will panic if rhs is zero. See u128::strict_rem.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub fn strict_div_euclid(self, rhs: Self) -> Self

Strict Euclidean division. Computes self.div_euclid(rhs).

Strict division on unsigned types is just normal division. There’s no way overflow could ever happen. This function exists so that all operations are accounted for in the strict operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.strict_div(rhs).

§Panics

This function will panic if rhs is zero. See u128::strict_div_euclid.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub fn strict_rem_euclid(self, rhs: Self) -> Self

Strict Euclidean modulo. Computes self.rem_euclid(rhs).

Strict modulo calculation on unsigned types is just the regular remainder calculation. There’s no way overflow could ever happen. This function exists so that all operations are accounted for in the strict operations. Since, for the positive integers, all common definitions of division are equal, this is exactly equal to self.strict_rem(rhs).

§Panics

This function will panic if rhs is zero. See u128::strict_rem_euclid.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

pub const fn strict_neg(self) -> Self

Strict negation. Computes -self, panicking unless self == 0.

Note that negating any positive integer will overflow.

§Panics
§Overflow behavior

This function will always panic on overflow, regardless of whether overflow checks are enabled. See u128::strict_neg.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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 u128::unchecked_add.

Source

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 u128::unchecked_sub.

Source

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 u128::unchecked_mul.

Source

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 u128::unchecked_shl.

Source

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 u128::unchecked_shr.

Source

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.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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.

This is a nightly-only experimental API in the Rust core implementation, and therefore is subject to change at any time.
Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Many different algorithms were attempted, with a soft mulx approach (1), a flat, fixed-width long multiplication (2), and a short-circuiting long multiplication (3). Algorithm (3) had the best performance for 128-bit multiplication, however, algorithm (1) was better for smaller type sizes.

This also optimized much better when multiplying by a single or a half-sized item: rather than using 4 limbs, if we’re multiplying (u128, u128) * u128, we can use 2 limbs for the right operand, and for (u128, u128) * u64, only 1 limb.

Using algorithm (3), the addition of (u128, u128) + (u128, u128) is in the worst case 10 mul and 13 add instructions, while (u128, u128) + u64 is always 4 mul and 3 add instructions without any branching. This is extremely efficient.

Source

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.

§Panics

This panics if the divisor is 0.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Many different algorithms were attempted, with a soft mulx approach (1), a flat, fixed-width long multiplication (2), and a short-circuiting long multiplication (3). Algorithm (3) had the best performance for 128-bit multiplication, however, algorithm (1) was better for smaller type sizes.

This also optimized much better when multiplying by a single or a half-sized item: rather than using 4 limbs, if we’re multiplying (u128, u128) * u128, we can use 2 limbs for the right operand, and for (u128, u128) * u64, only 1 limb.

§Assembly

The analysis here is practically identical to that of wrapping_mul_ulimb.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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-9
  • a-z
  • A-Z

This only has rudimentary optimizations.

§Panics

This function panics if radix is not in the range from 2 to 36.

Source

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-9
  • a-z
  • A-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 Add<&U384> for U384

Source§

type Output = <U384 as Add>::Output

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for U384

Source§

type Output = U384

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign<&U384> for U384

Source§

fn add_assign(&mut self, other: &Self)

Performs the += operation. Read more
Source§

impl AddAssign for U384

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl Binary for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl BitAnd<&U384> for U384

Source§

type Output = <U384 as BitAnd>::Output

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd for U384

Source§

type Output = U384

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAndAssign<&U384> for U384

Source§

fn bitand_assign(&mut self, other: &Self)

Performs the &= operation. Read more
Source§

impl BitAndAssign for U384

Source§

fn bitand_assign(&mut self, other: Self)

Performs the &= operation. Read more
Source§

impl BitOr<&U384> for U384

Source§

type Output = <U384 as BitOr>::Output

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr for U384

Source§

type Output = U384

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign<&U384> for U384

Source§

fn bitor_assign(&mut self, other: &Self)

Performs the |= operation. Read more
Source§

impl BitOrAssign for U384

Source§

fn bitor_assign(&mut self, other: Self)

Performs the |= operation. Read more
Source§

impl BitXor<&U384> for U384

Source§

type Output = <U384 as BitXor>::Output

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor for U384

Source§

type Output = U384

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Self) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign<&U384> for U384

Source§

fn bitxor_assign(&mut self, other: &Self)

Performs the ^= operation. Read more
Source§

impl BitXorAssign for U384

Source§

fn bitxor_assign(&mut self, other: Self)

Performs the ^= operation. Read more
Source§

impl Clone for U384

Source§

fn clone(&self) -> U384

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for U384

Source§

fn default() -> U384

Returns the “default value” for a type. Read more
Source§

impl Display for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Div<&U384> for U384

Source§

type Output = <U384 as Div>::Output

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &Self) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for U384

Source§

type Output = U384

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<&U384> for U384

Source§

fn div_assign(&mut self, other: &Self)

Performs the /= operation. Read more
Source§

impl DivAssign for U384

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

impl From<bool> for U384

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<char> for U384

Source§

fn from(value: char) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for U384

Source§

fn from(value: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for U384

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for U384

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for U384

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for U384

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl FromStr for U384

Source§

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 the lexical implementation.

Source§

type Err = ParseIntError

The associated error which can be returned from parsing.
Source§

impl Hash for U384

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl LowerExp for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl LowerHex for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Mul<&U384> for U384

Source§

type Output = <U384 as Mul>::Output

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for U384

Source§

type Output = U384

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<&U384> for U384

Source§

fn mul_assign(&mut self, other: &Self)

Performs the *= operation. Read more
Source§

impl MulAssign for U384

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl Not for &U384

Source§

type Output = <U384 as Not>::Output

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl Not for U384

Source§

type Output = U384

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl Octal for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Ord for U384

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for U384

Source§

fn eq(&self, other: &U384) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for U384

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
Source§

fn lt(&self, other: &Self) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
Source§

fn le(&self, other: &Self) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
Source§

fn gt(&self, other: &Self) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
Source§

fn ge(&self, other: &Self) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem<&U384> for U384

Source§

type Output = <U384 as Rem>::Output

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &Self) -> Self::Output

Performs the % operation. Read more
Source§

impl Rem for U384

Source§

type Output = U384

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
Source§

impl RemAssign<&U384> for U384

Source§

fn rem_assign(&mut self, other: &Self)

Performs the %= operation. Read more
Source§

impl RemAssign for U384

Source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
Source§

impl Shl<&I384> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &I384) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&U384> for I384

Source§

type Output = <I384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &U384) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&U384> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: &Self) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i128> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &i128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i16> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &i16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i32> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &i32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i64> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &i64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&i8> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &i8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&isize> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &isize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u128> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &u128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u16> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &u16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u32> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &u32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u64> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &u64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&u8> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &u8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<&usize> for U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &usize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<I384> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: I384) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<U384> for I384

Source§

type Output = I384

The resulting type after applying the << operator.
Source§

fn shl(self, other: U384) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i128> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: i128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i16> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: i16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i32> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: i32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i64> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: i64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<i8> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: i8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<isize> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: isize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u128> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: u128) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u16> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: u16) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u32> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: u32) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u64> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: u64) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<u8> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: u8) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<usize> for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: usize) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl for &U384

Source§

type Output = <U384 as Shl>::Output

The resulting type after applying the << operator.
Source§

fn shl(self, other: &U384) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl for U384

Source§

type Output = U384

The resulting type after applying the << operator.
Source§

fn shl(self, other: Self) -> Self::Output

Performs the << operation. Read more
Source§

impl ShlAssign<&I384> for U384

Source§

fn shl_assign(&mut self, other: &I384)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&U384> for I384

Source§

fn shl_assign(&mut self, other: &U384)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i128> for U384

Source§

fn shl_assign(&mut self, other: &i128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i16> for U384

Source§

fn shl_assign(&mut self, other: &i16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i32> for U384

Source§

fn shl_assign(&mut self, other: &i32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i64> for U384

Source§

fn shl_assign(&mut self, other: &i64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&i8> for U384

Source§

fn shl_assign(&mut self, other: &i8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&isize> for U384

Source§

fn shl_assign(&mut self, other: &isize)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u128> for U384

Source§

fn shl_assign(&mut self, other: &u128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u16> for U384

Source§

fn shl_assign(&mut self, other: &u16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u32> for U384

Source§

fn shl_assign(&mut self, other: &u32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u64> for U384

Source§

fn shl_assign(&mut self, other: &u64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&u8> for U384

Source§

fn shl_assign(&mut self, other: &u8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<&usize> for U384

Source§

fn shl_assign(&mut self, other: &usize)

Performs the <<= operation. Read more
Source§

impl ShlAssign<I384> for U384

Source§

fn shl_assign(&mut self, other: I384)

Performs the <<= operation. Read more
Source§

impl ShlAssign<U384> for I384

Source§

fn shl_assign(&mut self, other: U384)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i128> for U384

Source§

fn shl_assign(&mut self, other: i128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i16> for U384

Source§

fn shl_assign(&mut self, other: i16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i32> for U384

Source§

fn shl_assign(&mut self, other: i32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i64> for U384

Source§

fn shl_assign(&mut self, other: i64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<i8> for U384

Source§

fn shl_assign(&mut self, other: i8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<isize> for U384

Source§

fn shl_assign(&mut self, other: isize)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u128> for U384

Source§

fn shl_assign(&mut self, other: u128)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u16> for U384

Source§

fn shl_assign(&mut self, other: u16)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u32> for U384

Source§

fn shl_assign(&mut self, other: u32)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u64> for U384

Source§

fn shl_assign(&mut self, other: u64)

Performs the <<= operation. Read more
Source§

impl ShlAssign<u8> for U384

Source§

fn shl_assign(&mut self, other: u8)

Performs the <<= operation. Read more
Source§

impl ShlAssign<usize> for U384

Source§

fn shl_assign(&mut self, other: usize)

Performs the <<= operation. Read more
Source§

impl Shr<&I384> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &I384) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&U384> for I384

Source§

type Output = <I384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &U384) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&U384> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: &Self) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i128> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i16> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i32> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i64> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&i8> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&isize> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u128> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u16> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u32> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u64> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&u8> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<&usize> for U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<I384> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: I384) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<U384> for I384

Source§

type Output = I384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: U384) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i128> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: i128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i16> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: i16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i32> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: i32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i64> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: i64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<i8> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: i8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<isize> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: isize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u128> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: u128) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u16> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: u16) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u32> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: u32) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u64> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: u64) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<u8> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: u8) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<usize> for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: usize) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr for &U384

Source§

type Output = <U384 as Shr>::Output

The resulting type after applying the >> operator.
Source§

fn shr(self, other: &U384) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr for U384

Source§

type Output = U384

The resulting type after applying the >> operator.
Source§

fn shr(self, other: Self) -> Self::Output

Performs the >> operation. Read more
Source§

impl ShrAssign<&I384> for U384

Source§

fn shr_assign(&mut self, other: &I384)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&U384> for I384

Source§

fn shr_assign(&mut self, other: &U384)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i128> for U384

Source§

fn shr_assign(&mut self, other: &i128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i16> for U384

Source§

fn shr_assign(&mut self, other: &i16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i32> for U384

Source§

fn shr_assign(&mut self, other: &i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i64> for U384

Source§

fn shr_assign(&mut self, other: &i64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&i8> for U384

Source§

fn shr_assign(&mut self, other: &i8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&isize> for U384

Source§

fn shr_assign(&mut self, other: &isize)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u128> for U384

Source§

fn shr_assign(&mut self, other: &u128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u16> for U384

Source§

fn shr_assign(&mut self, other: &u16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u32> for U384

Source§

fn shr_assign(&mut self, other: &u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u64> for U384

Source§

fn shr_assign(&mut self, other: &u64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&u8> for U384

Source§

fn shr_assign(&mut self, other: &u8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<&usize> for U384

Source§

fn shr_assign(&mut self, other: &usize)

Performs the >>= operation. Read more
Source§

impl ShrAssign<I384> for U384

Source§

fn shr_assign(&mut self, other: I384)

Performs the >>= operation. Read more
Source§

impl ShrAssign<U384> for I384

Source§

fn shr_assign(&mut self, other: U384)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i128> for U384

Source§

fn shr_assign(&mut self, other: i128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i16> for U384

Source§

fn shr_assign(&mut self, other: i16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i32> for U384

Source§

fn shr_assign(&mut self, other: i32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i64> for U384

Source§

fn shr_assign(&mut self, other: i64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<i8> for U384

Source§

fn shr_assign(&mut self, other: i8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<isize> for U384

Source§

fn shr_assign(&mut self, other: isize)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u128> for U384

Source§

fn shr_assign(&mut self, other: u128)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u16> for U384

Source§

fn shr_assign(&mut self, other: u16)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u32> for U384

Source§

fn shr_assign(&mut self, other: u32)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u64> for U384

Source§

fn shr_assign(&mut self, other: u64)

Performs the >>= operation. Read more
Source§

impl ShrAssign<u8> for U384

Source§

fn shr_assign(&mut self, other: u8)

Performs the >>= operation. Read more
Source§

impl ShrAssign<usize> for U384

Source§

fn shr_assign(&mut self, other: usize)

Performs the >>= operation. Read more
Source§

impl Sub<&U384> for U384

Source§

type Output = <U384 as Sub>::Output

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &Self) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for U384

Source§

type Output = U384

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign<&U384> for U384

Source§

fn sub_assign(&mut self, other: &Self)

Performs the -= operation. Read more
Source§

impl SubAssign for U384

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl TryFrom<I384> for U384

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: I384) -> Result<Self, TryFromIntError>

Performs the conversion.
Source§

impl TryFrom<U384> for I384

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: U384) -> Result<Self, TryFromIntError>

Performs the conversion.
Source§

impl TryFrom<i128> for U384

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: i128) -> Result<Self, TryFromIntError>

Performs the conversion.
Source§

impl TryFrom<i16> for U384

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: i16) -> Result<Self, TryFromIntError>

Performs the conversion.
Source§

impl TryFrom<i32> for U384

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: i32) -> Result<Self, TryFromIntError>

Performs the conversion.
Source§

impl TryFrom<i64> for U384

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: i64) -> Result<Self, TryFromIntError>

Performs the conversion.
Source§

impl TryFrom<i8> for U384

Source§

type Error = TryFromIntError

The type returned in the event of a conversion error.
Source§

fn try_from(u: i8) -> Result<Self, TryFromIntError>

Performs the conversion.
Source§

impl UpperExp for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl UpperHex for U384

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Copy for U384

Source§

impl Eq for U384

Source§

impl StructuralPartialEq for U384

Auto Trait Implementations§

§

impl Freeze for U384

§

impl RefUnwindSafe for U384

§

impl Send for U384

§

impl Sync for U384

§

impl Unpin for U384

§

impl UnwindSafe for U384

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.