Struct fixed_bigint::fixeduint::FixedUInt [−][src]
pub struct FixedUInt<T, const N: usize> where
T: MachineWord, { /* fields omitted */ }
Expand description
Fixed-size unsigned integer, represented by array of N words of builtin unsigned type T
Implementations
Returns number of used bits.
Performs a division, returning both the quotient and reminder in a tuple.
Create a little-endian integer value from its representation as a byte array in little endian.
Trait Implementations
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
Adds two numbers, checking for overflow. If overflow happens, None
is
returned. Read more
Divides two numbers, checking for underflow, overflow and division by
zero. If any of that happens, None
is returned. Read more
Multiplies two numbers, checking for underflow or overflow. If underflow
or overflow happens, None
is returned. Read more
Finds the remainder of dividing two numbers, checking for underflow, overflow and division
by zero. If any of that happens, None
is returned. Read more
Checked shift left. Computes self << rhs
, returning None
if rhs
is larger than or equal to the number of bits in self
. Read more
Checked shift right. Computes self >> rhs
, returning None
if rhs
is larger than or equal to the number of bits in self
. Read more
Subtracts two numbers, checking for underflow. If underflow happens,
None
is returned. Read more
Performs the /=
operation. Read more
Performs the /=
operation. Read more
Converts an i64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u64
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an isize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an i128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts a usize
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u8
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u16
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts an u128
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Converts a f32
to return an optional value of this type. If the
value cannot be represented by this type, then None
is returned. Read more
Returns true
if self
is a multiple of other
. Read more
Simultaneous truncated integer division and modulus.
Returns (quotient, remainder)
. Read more
Greatest Common Divisor (GCD) and Lowest Common Multiple (LCM) together. Read more
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
type FromStrRadixErr = ParseIntError
Convert from a string and radix (typically 2..=36
). Read more
Creates a number from another value that can be converted into
a primitive via the ToPrimitive
trait. If the source value cannot be
represented by the target type, then None
is returned. 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
Returns the number of ones in the binary representation of self
. Read more
Returns the number of zeros in the binary representation of self
. Read more
Returns the number of leading zeros in the binary representation
of self
. Read more
Returns the number of trailing zeros in the binary representation
of self
. Read more
Shifts the bits to the left by a specified amount, n
, wrapping
the truncated bits to the end of the resulting integer. Read more
Shifts the bits to the right by a specified amount, n
, wrapping
the truncated bits to the beginning of the resulting integer. Read more
Shifts the bits to the left by a specified amount, n
, filling
zeros in the least significant bits. Read more
Shifts the bits to the right by a specified amount, n
, copying
the “sign bit” in the most significant bits even for unsigned types. Read more
Shifts the bits to the left by a specified amount, n
, filling
zeros in the least significant bits. Read more
Shifts the bits to the right by a specified amount, n
, filling
zeros in the most significant bits. Read more
Reverses the byte order of the integer. Read more
Convert an integer from big endian to the target’s endianness. Read more
Convert an integer from little endian to the target’s endianness. Read more
Performs the %=
operation. Read more
Performs the %=
operation. Read more
Note: This is marked deprecated, but still used by PrimInt
Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
Saturating addition operator. Returns a+b, saturating at the numeric bounds instead of overflowing.
Saturating multiplication. Computes self * other
, saturating at the relevant high or low boundary of
the type. Read more
Saturating subtraction operator. Returns a-b, saturating at the numeric bounds instead of overflowing.
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
Converts the value of self
to an i64
. If the value cannot be
represented by an i64
, then None
is returned. Read more
Converts the value of self
to a u64
. If the value cannot be
represented by a u64
, then None
is returned. Read more
Converts the value of self
to an isize
. If the value cannot be
represented by an isize
, then None
is returned. Read more
Converts the value of self
to an i8
. If the value cannot be
represented by an i8
, then None
is returned. Read more
Converts the value of self
to an i16
. If the value cannot be
represented by an i16
, then None
is returned. Read more
Converts the value of self
to an i32
. If the value cannot be
represented by an i32
, then None
is returned. Read more
Converts the value of self
to an i128
. If the value cannot be
represented by an i128
(i64
under the default implementation), then
None
is returned. Read more
Converts the value of self
to a usize
. If the value cannot be
represented by a usize
, then None
is returned. Read more
Converts the value of self
to a u8
. If the value cannot be
represented by a u8
, then None
is returned. Read more
Converts the value of self
to a u16
. If the value cannot be
represented by a u16
, then None
is returned. Read more
Converts the value of self
to a u32
. If the value cannot be
represented by a u32
, then None
is returned. Read more
Converts the value of self
to a u128
. If the value cannot be
represented by a u128
(u64
under the default implementation), then
None
is returned. Read more
Converts the value of self
to an f32
. Overflows may map to positive
or negative inifinity, otherwise None
is returned if the value cannot
be represented by an f32
. Read more
Wrapping (modular) addition. Computes self + other
, wrapping around at the boundary of
the type. Read more
Wrapping (modular) multiplication. Computes self * other
, wrapping around at the boundary
of the type. Read more
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. Read more
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. Read more
Wrapping (modular) subtraction. Computes self - other
, wrapping around at the boundary
of the type. Read more
Auto Trait Implementations
impl<T, const N: usize> RefUnwindSafe for FixedUInt<T, N> where
T: RefUnwindSafe,
impl<T, const N: usize> UnwindSafe for FixedUInt<T, N> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more