Struct casper_types::U512
source ·
[−]Expand description
Little-endian large integer type
Tuple Fields
0: [u64; 8]Implementations
Converts a string slice in a given base to an integer. Only supports radixes of 10 and 16.
Convert from a decimal string.
Conversion to u64 with overflow checking
Panics
Panics if the number is larger than u64::max_value().
Conversion to usize with overflow checking
Panics
Panics if the number is larger than usize::max_value().
Returns the number of leading zeros in the binary representation of self.
Returns the number of trailing zeros in the binary representation of self.
Write to the slice in big-endian format.
Write to the slice in little-endian format.
Compute the highest n such that n * n <= self.
Fast exponentiation by squaring https://en.wikipedia.org/wiki/Exponentiation_by_squaring
Panics
Panics if the result overflows the type.
Fast exponentiation by squaring. Returns result and overflow flag.
Checked exponentiation. Returns None if overflow occurred.
Addition which overflows and returns a flag if it does.
Addition which saturates at the maximum value (Self::MAX).
Checked addition. Returns None if overflow occurred.
Subtraction which underflows and returns a flag if it does.
Subtraction which saturates at zero.
Checked subtraction. Returns None if overflow occurred.
Computes the absolute difference between self and other.
Multiply with overflow, returning a flag if it does.
Multiplication which saturates at the maximum value..
Checked multiplication. Returns None if overflow occurred.
Checked division. Returns None if other == 0.
Checked modulus. Returns None if other == 0.
Checked negation. Returns None unless self == 0.
Converts from big endian representation bytes in memory.
Converts from little endian representation bytes in memory.
Trait Implementations
Performs the += operation. Read more
Get a reference to the underlying little-endian words.
Deserialize this value from the given Serde deserializer. Read more
Generate a random value of T, using rng as the source of randomness.
Create an iterator that generates random values of T, using rng as
the source of randomness. Read more
Performs the /= operation. Read more
Unsigned integer division. Returns the same result as div (/).
Unsigned integer modulo operation. Returns the same result as rem (%).
Calculates the Greatest Common Divisor (GCD) of the number and other
Calculates the Lowest Common Multiple (LCM) of the number and other.
Calculates the Greatest Common Divisor (GCD) and
Lowest Common Multiple (LCM) of the number and other.
Returns true if the number is a multiple of other.
Simultaneous truncated integer division and modulus.
Greatest common divisor and Bézout coefficients. Read more
fn extended_gcd_lcm(&self, other: &Self) -> (ExtendedGcd<Self>, Self) where
Self: Clone + Signed,
fn extended_gcd_lcm(&self, other: &Self) -> (ExtendedGcd<Self>, Self) where
Self: Clone + Signed,
Greatest common divisor, least common multiple, and Bézout coefficients.
Simultaneous floored integer division and modulus.
Returns (quotient, remainder). Read more
Rounds up to nearest multiple of argument. Read more
Rounds down to nearest multiple of argument. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
Performs the *= operation. Read more
type FromStrRadixErr = UIntParseError
Convert from a string and radix (typically 2..=36). Read more
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Performs the %= operation. Read more
Performs the <<= operation. Read more
Performs the >>= operation. Read more
Performs the -= operation. Read more
Returns the length of the Vec<u8> which would be returned from a successful call to
to_bytes() or into_bytes(). The data is not actually serialized, so this call is
relatively cheap. Read more
Wrapping (modular) addition. Computes self + other, wrapping around at the boundary of
the type. Read more
Wrapping (modular) subtraction. Computes self - other, wrapping around at the boundary
of the type. Read more
Auto Trait Implementations
impl RefUnwindSafe for U512
impl UnwindSafe for U512
Blanket Implementations
Mutably borrows from an owned value. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when
Debug-formatted. Read more
Causes self to use its LowerExp implementation when
Debug-formatted. Read more
Causes self to use its LowerHex implementation when
Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when
Debug-formatted. Read more
Causes self to use its UpperExp implementation when
Debug-formatted. Read more
Causes self to use its UpperHex implementation when
Debug-formatted. Read more
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more
Provides immutable access to the reference for inspection.
Calls tap_ref in debug builds, and does nothing in release builds.
Provides mutable access to the reference for modification.
Calls tap_ref_mut in debug builds, and does nothing in release builds.
Provides immutable access to the borrow for inspection. Read more
Calls tap_borrow in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
Immutably dereferences self for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self for modification.
