Struct gmp::mpz::Mpz[][src]

pub struct Mpz { /* fields omitted */ }

Implementations

impl Mpz[src]

pub unsafe fn inner(&self) -> mpz_srcptr[src]

pub unsafe fn inner_mut(&mut self) -> mpz_ptr[src]

pub fn new() -> Mpz[src]

pub fn new_reserve(n: usize) -> Mpz[src]

pub fn reserve(&mut self, n: usize)[src]

pub fn size_in_base(&self, base: u8) -> usize[src]

pub fn to_str_radix(&self, base: u8) -> String[src]

pub fn from_str_radix(s: &str, base: u8) -> Result<Mpz, ParseMpzError>[src]

pub fn set(&mut self, other: &Mpz)[src]

pub fn set_from_str_radix(&mut self, s: &str, base: u8) -> bool[src]

pub fn bit_length(&self) -> usize[src]

pub fn compl(&self) -> Mpz[src]

pub fn abs(&self) -> Mpz[src]

pub fn div_floor(&self, other: &Mpz) -> Mpz[src]

pub fn mod_floor(&self, other: &Mpz) -> Mpz[src]

pub fn probab_prime(&self, reps: i32) -> ProbabPrimeResult[src]

Determine whether n is prime.

This function performs some trial divisions, then reps Miller-Rabin probabilistic primality tests. A higher reps value will reduce the chances of a non-prime being identified as “probably prime”. A composite number will be identified as a prime with a probability of less than 4^(-reps). Reasonable values of reps are between 15 and 50.

pub fn nextprime(&self) -> Mpz[src]

pub fn gcd(&self, other: &Mpz) -> Mpz[src]

pub fn gcdext(&self, other: &Mpz) -> (Mpz, Mpz, Mpz)[src]

Given (a, b), return (g, s, t) such that g = gcd(a, b) = sa + tb.

pub fn lcm(&self, other: &Mpz) -> Mpz[src]

pub fn is_multiple_of(&self, other: &Mpz) -> bool[src]

pub fn divides(&self, other: &Mpz) -> bool[src]

pub fn modulus(&self, modulo: &Mpz) -> Mpz[src]

pub fn invert(&self, modulo: &Mpz) -> Option<Mpz>[src]

pub fn popcount(&self) -> usize[src]

pub fn pow(&self, exp: u32) -> Mpz[src]

pub fn powm(&self, exp: &Mpz, modulus: &Mpz) -> Mpz[src]

pub fn powm_sec(&self, exp: &Mpz, modulus: &Mpz) -> Mpz[src]

pub fn ui_pow_ui(x: u32, y: u32) -> Mpz[src]

pub fn hamdist(&self, other: &Mpz) -> usize[src]

pub fn setbit(&mut self, bit_index: usize)[src]

pub fn clrbit(&mut self, bit_index: usize)[src]

pub fn combit(&mut self, bit_index: usize)[src]

pub fn tstbit(&self, bit_index: usize) -> bool[src]

pub fn root(&self, n: u32) -> Mpz[src]

pub fn sqrt(&self) -> Mpz[src]

pub fn millerrabin(&self, reps: i32) -> i32[src]

pub fn sign(&self) -> Sign[src]

pub fn one() -> Mpz[src]

pub fn zero() -> Mpz[src]

pub fn is_zero(&self) -> bool[src]

Trait Implementations

impl<'a> Add<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl Add<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a> Add<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl Add<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a> Add<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the + operator.

impl<'a> AddAssign<&'a Mpz> for Mpz[src]

impl AddAssign<Mpz> for Mpz[src]

impl AddAssign<u64> for Mpz[src]

impl<'a> BitAnd<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl<'a, 'b> BitAnd<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl BitAnd<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl<'a> BitAnd<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the & operator.

impl<'a> BitAndAssign<&'a Mpz> for Mpz[src]

impl BitAndAssign<Mpz> for Mpz[src]

impl<'a> BitOr<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl<'a, 'b> BitOr<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl BitOr<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl<'a> BitOr<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the | operator.

impl<'a> BitOrAssign<&'a Mpz> for Mpz[src]

impl BitOrAssign<Mpz> for Mpz[src]

impl<'a> BitXor<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl<'a, 'b> BitXor<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl BitXor<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl<'a> BitXor<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the ^ operator.

impl<'a> BitXorAssign<&'a Mpz> for Mpz[src]

impl BitXorAssign<Mpz> for Mpz[src]

impl Clone for Mpz[src]

impl Debug for Mpz[src]

impl Display for Mpz[src]

impl<'a> Div<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a, 'b> Div<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl Div<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a> Div<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl Div<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a> Div<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the / operator.

impl<'a> DivAssign<&'a Mpz> for Mpz[src]

impl DivAssign<Mpz> for Mpz[src]

impl DivAssign<u64> for Mpz[src]

impl Drop for Mpz[src]

impl Eq for Mpz[src]

impl<'a> From<&'a [u8]> for Mpz[src]

impl<'a> From<&'a Mpz> for Mpq[src]

impl From<Mpz> for Mpq[src]

impl From<i32> for Mpz[src]

impl From<i64> for Mpz[src]

impl From<u32> for Mpz[src]

impl From<u64> for Mpz[src]

impl FromStr for Mpz[src]

type Err = ParseMpzError

The associated error which can be returned from parsing.

impl Hash for Mpz[src]

impl<'a> Mul<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Mul<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Mul<i64> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<i64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl Mul<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> Mul<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the * operator.

impl<'a> MulAssign<&'a Mpz> for Mpz[src]

impl MulAssign<Mpz> for Mpz[src]

impl MulAssign<i64> for Mpz[src]

impl MulAssign<u64> for Mpz[src]

impl<'b> Neg for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl Neg for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'b> Not for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the ! operator.

impl Not for Mpz[src]

type Output = Mpz

The resulting type after applying the ! operator.

impl One for Mpz[src]

impl Ord for Mpz[src]

impl PartialEq<Mpz> for Mpz[src]

impl PartialOrd<Mpz> for Mpz[src]

impl<'a> Rem<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a, 'b> Rem<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl Rem<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a> Rem<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl Rem<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a> Rem<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the % operator.

impl<'a> RemAssign<&'a Mpz> for Mpz[src]

impl RemAssign<Mpz> for Mpz[src]

impl RemAssign<u64> for Mpz[src]

impl Send for Mpz[src]

impl<'b> Shl<usize> for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the << operator.

impl Shl<usize> for Mpz[src]

type Output = Mpz

The resulting type after applying the << operator.

impl ShlAssign<usize> for Mpz[src]

impl<'b> Shr<usize> for &'b Mpz[src]

type Output = Mpz

The resulting type after applying the >> operator.

impl Shr<usize> for Mpz[src]

type Output = Mpz

The resulting type after applying the >> operator.

impl ShrAssign<usize> for Mpz[src]

impl<'a> Sub<&'a Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'b Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl Sub<Mpz> for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a> Sub<Mpz> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl Sub<u64> for Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a> Sub<u64> for &'a Mpz[src]

type Output = Mpz

The resulting type after applying the - operator.

impl<'a> SubAssign<&'a Mpz> for Mpz[src]

impl SubAssign<Mpz> for Mpz[src]

impl SubAssign<u64> for Mpz[src]

impl Sync for Mpz[src]

impl Zero for Mpz[src]

Auto Trait Implementations

impl RefUnwindSafe for Mpz

impl Unpin for Mpz

impl UnwindSafe for Mpz

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> NumAssignOps<Rhs> for T where
    T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, 
[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, Base> RefNum<Base> for T where
    T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>, 
[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.