Struct num_modular::udouble
source · [−]Expand description
A double width integer type based on the largest built-in integer (u128)
It’s used to support double-width operations on u128. Although it can be considered as u256, it’s not as feature-rich as other crates since it’s only designed to support this crate.
Fields
hi: umax
lo: umax
Implementations
sourceimpl udouble
impl udouble
pub fn widening_add(lhs: umax, rhs: umax) -> Self
sourcepub fn widening_mul(lhs: umax, rhs: umax) -> Self
pub fn widening_mul(lhs: umax, rhs: umax) -> Self
Calculate multiplication of two umax integers with result represented in double width integer
pub fn overflowing_add(&self, rhs: Self) -> (Self, bool)
pub fn overflowing_mul(&self, rhs: Self) -> (Self, bool)
Trait Implementations
sourceimpl AddAssign<u128> for udouble
impl AddAssign<u128> for udouble
sourcefn add_assign(&mut self, rhs: umax)
fn add_assign(&mut self, rhs: umax)
Performs the +=
operation. Read more
sourceimpl AddAssign<udouble> for udouble
impl AddAssign<udouble> for udouble
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the +=
operation. Read more
sourceimpl Ord for udouble
impl Ord for udouble
sourceimpl PartialOrd<udouble> for udouble
impl PartialOrd<udouble> for udouble
sourcefn partial_cmp(&self, other: &udouble) -> Option<Ordering>
fn partial_cmp(&self, other: &udouble) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ShlAssign<u32> for udouble
impl ShlAssign<u32> for udouble
sourcefn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the <<=
operation. Read more
sourceimpl ShrAssign<u32> for udouble
impl ShrAssign<u32> for udouble
sourcefn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the >>=
operation. Read more
sourceimpl SubAssign<udouble> for udouble
impl SubAssign<udouble> for udouble
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the -=
operation. Read more
impl Copy for udouble
impl Eq for udouble
impl StructuralEq for udouble
impl StructuralPartialEq for udouble
Auto Trait Implementations
impl RefUnwindSafe for udouble
impl Send for udouble
impl Sync for udouble
impl Unpin for udouble
impl UnwindSafe for udouble
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more