[][src]Struct ramp::ll::limb::Limb

pub struct Limb(pub BaseInt);

Helper newtype for operations.

A "Limb" is a single digit in base 2^word size.

Implementations

impl Limb[src]

pub const BITS: usize[src]

pub const B: Limb[src]

pub fn high_part(self) -> Limb[src]

Returns the high half of the limb

pub fn low_part(self) -> Limb[src]

Returns the low half of the limb

pub fn add_overflow(self, other: Limb) -> (Limb, bool)[src]

Performs self + other, returning the result and whether or not the addition overflowed

pub fn sub_overflow(self, other: Limb) -> (Limb, bool)[src]

Performs self - other, returning the result and whether or not the subtraction overflowed

pub fn mul_lo(self, other: Limb) -> Limb[src]

Performs self * other returning the lower half of the product

pub fn mul_hi(self, other: Limb) -> Limb[src]

Performs self * other returning the higher half of the product

pub fn mul_hilo(self, other: Limb) -> (Limb, Limb)[src]

Performs self * other returning the two-limb result as (high, low).

pub fn invert(self) -> Limb[src]

pub fn high_bit_set(self) -> bool[src]

Returns whether or not the highest bit in the limb is set.

Division algorithms often require the highest limb of the divisor to be d >= BASE/2.

pub fn leading_zeros(self) -> BaseInt[src]

Returns the number of leading zeros in the limb

pub fn trailing_zeros(self) -> BaseInt[src]

Returns the number of trailing zeros in the limb

Trait Implementations

impl Add<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the + operator.

impl Add<Limb> for BaseInt[src]

type Output = Limb

The resulting type after applying the + operator.

impl Add<Limb> for Int[src]

type Output = Int

The resulting type after applying the + operator.

impl Add<bool> for Limb[src]

type Output = Limb

The resulting type after applying the + operator.

impl Add<u32> for Limb[src]

type Output = Limb

The resulting type after applying the + operator.

impl AddAssign<Limb> for Int[src]

impl BitAnd<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the & operator.

impl<'a> BitAnd<Limb> for Int[src]

type Output = Int

The resulting type after applying the & operator.

impl BitAndAssign<Limb> for Int[src]

impl BitOr<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the | operator.

impl BitOr<Limb> for Int[src]

type Output = Int

The resulting type after applying the | operator.

impl BitOrAssign<Limb> for Int[src]

impl BitXor<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the ^ operator.

impl<'a> BitXor<Limb> for Int[src]

type Output = Int

The resulting type after applying the ^ operator.

impl BitXorAssign<Limb> for Int[src]

impl Clone for Limb[src]

impl Copy for Limb[src]

impl Debug for Limb[src]

impl Display for Limb[src]

impl Div<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the / operator.

impl Div<Limb> for Int[src]

type Output = Int

The resulting type after applying the / operator.

impl Div<u32> for Limb[src]

type Output = Limb

The resulting type after applying the / operator.

impl DivAssign<Limb> for Int[src]

impl DivRem<Limb> for Int[src]

type Output = (Int, Limb)

impl Eq for Limb[src]

impl Hash for Limb[src]

impl Mul<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the * operator.

impl Mul<Limb> for BaseInt[src]

type Output = Limb

The resulting type after applying the * operator.

impl Mul<Limb> for Int[src]

type Output = Int

The resulting type after applying the * operator.

impl Mul<u32> for Limb[src]

type Output = Limb

The resulting type after applying the * operator.

impl MulAssign<Limb> for Int[src]

impl Neg for Limb[src]

type Output = Limb

The resulting type after applying the - operator.

impl Not for Limb[src]

type Output = Limb

The resulting type after applying the ! operator.

impl Ord for Limb[src]

impl PartialEq<Int> for Limb[src]

impl PartialEq<Limb> for Limb[src]

impl PartialEq<Limb> for Int[src]

impl PartialEq<u32> for Limb[src]

impl PartialOrd<Int> for Limb[src]

impl PartialOrd<Limb> for Limb[src]

impl PartialOrd<Limb> for Int[src]

impl PartialOrd<u32> for Limb[src]

impl Rem<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the % operator.

impl Rem<Limb> for Int[src]

type Output = Int

The resulting type after applying the % operator.

impl Rem<u32> for Limb[src]

type Output = Limb

The resulting type after applying the % operator.

impl RemAssign<Limb> for Int[src]

impl<I> Shl<I> for Limb where
    BaseInt: Shl<I, Output = BaseInt>, 
[src]

type Output = Limb

The resulting type after applying the << operator.

impl<I> Shr<I> for Limb where
    BaseInt: Shr<I, Output = BaseInt>, 
[src]

type Output = Limb

The resulting type after applying the >> operator.

impl StructuralEq for Limb[src]

impl Sub<Limb> for Limb[src]

type Output = Limb

The resulting type after applying the - operator.

impl Sub<Limb> for BaseInt[src]

type Output = Limb

The resulting type after applying the - operator.

impl Sub<Limb> for Int[src]

type Output = Int

The resulting type after applying the - operator.

impl Sub<bool> for Limb[src]

type Output = Limb

The resulting type after applying the - operator.

impl Sub<u32> for Limb[src]

type Output = Limb

The resulting type after applying the - operator.

impl SubAssign<Limb> for Int[src]

Auto Trait Implementations

impl RefUnwindSafe for Limb

impl Send for Limb

impl Sync for Limb

impl Unpin for Limb

impl UnwindSafe for Limb

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.