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

`pub struct Mpz { /* fields omitted */ }`

## Methods

### `impl Mpz`[src]

#### `fn probab_prime(&self, reps: i32) -> ProbabPrimeResult`

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.

#### `fn gcdext(&self, other: &Mpz) -> (Mpz, Mpz, Mpz)`

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

## Trait Implementations

### `impl Drop for Mpz`[src]

#### `fn drop(&mut self)`

A method called when the value goes out of scope. Read more

### `impl Clone for Mpz`[src]

#### `fn clone(&self) -> Mpz`

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`1.0.0

Performs copy-assignment from `source`. Read more

### `impl PartialEq for Mpz`[src]

#### `fn eq(&self, other: &Mpz) -> bool`

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`1.0.0

This method tests for `!=`.

### `impl Ord for Mpz`[src]

#### `fn cmp(&self, other: &Mpz) -> Ordering`

This method returns an `Ordering` between `self` and `other`. Read more

### `impl PartialOrd for Mpz`[src]

#### `fn partial_cmp(&self, other: &Mpz) -> Option<Ordering>`

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`1.0.0

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`1.0.0

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`1.0.0

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl Add<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `+` operator

#### `fn add(self, other: Mpz) -> Mpz`

The method for the `+` operator

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

#### `type Output = Mpz`

The resulting type after applying the `+` operator

#### `fn add(self, other: &Mpz) -> Mpz`

The method for the `+` operator

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

#### `type Output = Mpz`

The resulting type after applying the `+` operator

#### `fn add(self, other: Mpz) -> Mpz`

The method for the `+` operator

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

#### `type Output = Mpz`

The resulting type after applying the `+` operator

#### `fn add(self, other: &Mpz) -> Mpz`

The method for the `+` operator

### `impl AddAssign<Mpz> for Mpz`[src]

#### `fn add_assign(&mut self, other: Mpz)`

The method for the `+=` operator

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

#### `fn add_assign(&mut self, other: &Mpz)`

The method for the `+=` operator

### `impl Add<u64> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `+` operator

#### `fn add(self, other: u64) -> Mpz`

The method for the `+` operator

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

#### `type Output = Mpz`

The resulting type after applying the `+` operator

#### `fn add(self, other: u64) -> Mpz`

The method for the `+` operator

### `impl AddAssign<u64> for Mpz`[src]

#### `fn add_assign(&mut self, other: u64)`

The method for the `+=` operator

### `impl Sub<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn sub(self, other: Mpz) -> Mpz`

The method for the `-` operator

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

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn sub(self, other: &Mpz) -> Mpz`

The method for the `-` operator

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

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn sub(self, other: Mpz) -> Mpz`

The method for the `-` operator

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

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn sub(self, other: &Mpz) -> Mpz`

The method for the `-` operator

### `impl SubAssign<Mpz> for Mpz`[src]

#### `fn sub_assign(&mut self, other: Mpz)`

The method for the `-=` operator

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

#### `fn sub_assign(&mut self, other: &Mpz)`

The method for the `-=` operator

### `impl Sub<u64> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn sub(self, other: u64) -> Mpz`

The method for the `-` operator

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

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn sub(self, other: u64) -> Mpz`

The method for the `-` operator

### `impl SubAssign<u64> for Mpz`[src]

#### `fn sub_assign(&mut self, other: u64)`

The method for the `-=` operator

### `impl Mul<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: Mpz) -> Mpz`

The method for the `*` operator

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

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: &Mpz) -> Mpz`

The method for the `*` operator

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

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: Mpz) -> Mpz`

The method for the `*` operator

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

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: &Mpz) -> Mpz`

The method for the `*` operator

### `impl MulAssign<Mpz> for Mpz`[src]

#### `fn mul_assign(&mut self, other: Mpz)`

The method for the `*=` operator

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

#### `fn mul_assign(&mut self, other: &Mpz)`

The method for the `*=` operator

### `impl Mul<i64> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: i64) -> Mpz`

The method for the `*` operator

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

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: i64) -> Mpz`

The method for the `*` operator

### `impl MulAssign<i64> for Mpz`[src]

#### `fn mul_assign(&mut self, other: i64)`

The method for the `*=` operator

### `impl Mul<u64> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: u64) -> Mpz`

The method for the `*` operator

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

#### `type Output = Mpz`

The resulting type after applying the `*` operator

#### `fn mul(self, other: u64) -> Mpz`

The method for the `*` operator

### `impl MulAssign<u64> for Mpz`[src]

#### `fn mul_assign(&mut self, other: u64)`

The method for the `*=` operator

### `impl Div<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `/` operator

#### `fn div(self, other: Mpz) -> Mpz`

The method for the `/` operator

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

#### `type Output = Mpz`

The resulting type after applying the `/` operator

#### `fn div(self, other: &Mpz) -> Mpz`

The method for the `/` operator

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

#### `type Output = Mpz`

The resulting type after applying the `/` operator

#### `fn div(self, other: Mpz) -> Mpz`

The method for the `/` operator

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

#### `type Output = Mpz`

The resulting type after applying the `/` operator

#### `fn div(self, other: &Mpz) -> Mpz`

The method for the `/` operator

### `impl DivAssign<Mpz> for Mpz`[src]

#### `fn div_assign(&mut self, other: Mpz)`

The method for the `/=` operator

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

#### `fn div_assign(&mut self, other: &Mpz)`

The method for the `/=` operator

### `impl Div<u64> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `/` operator

#### `fn div(self, other: u64) -> Mpz`

The method for the `/` operator

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

#### `type Output = Mpz`

The resulting type after applying the `/` operator

#### `fn div(self, other: u64) -> Mpz`

The method for the `/` operator

### `impl DivAssign<u64> for Mpz`[src]

#### `fn div_assign(&mut self, other: u64)`

The method for the `/=` operator

### `impl Rem<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `%` operator

#### `fn rem(self, other: Mpz) -> Mpz`

The method for the `%` operator

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

#### `type Output = Mpz`

The resulting type after applying the `%` operator

#### `fn rem(self, other: &Mpz) -> Mpz`

The method for the `%` operator

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

#### `type Output = Mpz`

The resulting type after applying the `%` operator

#### `fn rem(self, other: Mpz) -> Mpz`

The method for the `%` operator

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

#### `type Output = Mpz`

The resulting type after applying the `%` operator

#### `fn rem(self, other: &Mpz) -> Mpz`

The method for the `%` operator

### `impl RemAssign<Mpz> for Mpz`[src]

#### `fn rem_assign(&mut self, other: Mpz)`

The method for the `%=` operator

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

#### `fn rem_assign(&mut self, other: &Mpz)`

The method for the `%=` operator

### `impl Rem<u64> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `%` operator

#### `fn rem(self, other: u64) -> Mpz`

The method for the `%` operator

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

#### `type Output = Mpz`

The resulting type after applying the `%` operator

#### `fn rem(self, other: u64) -> Mpz`

The method for the `%` operator

### `impl RemAssign<u64> for Mpz`[src]

#### `fn rem_assign(&mut self, other: u64)`

The method for the `%=` operator

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

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn neg(self) -> Mpz`

The method for the unary `-` operator

### `impl Neg for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `-` operator

#### `fn neg(self) -> Mpz`

The method for the unary `-` operator

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

#### `type Output = Mpz`

The resulting type after applying the `!` operator

#### `fn not(self) -> Mpz`

The method for the unary `!` operator

### `impl Not for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `!` operator

#### `fn not(self) -> Mpz`

The method for the unary `!` operator

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

#### `fn from(other: &'a [u8]) -> Mpz`

Performs the conversion.

### `impl From<u64> for Mpz`[src]

#### `fn from(other: u64) -> Mpz`

Performs the conversion.

### `impl From<u32> for Mpz`[src]

#### `fn from(other: u32) -> Mpz`

Performs the conversion.

### `impl From<i64> for Mpz`[src]

#### `fn from(other: i64) -> Mpz`

Performs the conversion.

### `impl From<i32> for Mpz`[src]

#### `fn from(other: i32) -> Mpz`

Performs the conversion.

### `impl BitAnd<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `&` operator

#### `fn bitand(self, other: Mpz) -> Mpz`

The method for the `&` operator

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

#### `type Output = Mpz`

The resulting type after applying the `&` operator

#### `fn bitand(self, other: &Mpz) -> Mpz`

The method for the `&` operator

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

#### `type Output = Mpz`

The resulting type after applying the `&` operator

#### `fn bitand(self, other: Mpz) -> Mpz`

The method for the `&` operator

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

#### `type Output = Mpz`

The resulting type after applying the `&` operator

#### `fn bitand(self, other: &Mpz) -> Mpz`

The method for the `&` operator

### `impl BitAndAssign<Mpz> for Mpz`[src]

#### `fn bitand_assign(&mut self, other: Mpz)`

The method for the `&=` operator

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

#### `fn bitand_assign(&mut self, other: &Mpz)`

The method for the `&=` operator

### `impl BitOr<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `|` operator

#### `fn bitor(self, other: Mpz) -> Mpz`

The method for the `|` operator

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

#### `type Output = Mpz`

The resulting type after applying the `|` operator

#### `fn bitor(self, other: &Mpz) -> Mpz`

The method for the `|` operator

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

#### `type Output = Mpz`

The resulting type after applying the `|` operator

#### `fn bitor(self, other: Mpz) -> Mpz`

The method for the `|` operator

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

#### `type Output = Mpz`

The resulting type after applying the `|` operator

#### `fn bitor(self, other: &Mpz) -> Mpz`

The method for the `|` operator

### `impl BitOrAssign<Mpz> for Mpz`[src]

#### `fn bitor_assign(&mut self, other: Mpz)`

The method for the `|=` operator

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

#### `fn bitor_assign(&mut self, other: &Mpz)`

The method for the `|=` operator

### `impl BitXor<Mpz> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `^` operator

#### `fn bitxor(self, other: Mpz) -> Mpz`

The method for the `^` operator

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

#### `type Output = Mpz`

The resulting type after applying the `^` operator

#### `fn bitxor(self, other: &Mpz) -> Mpz`

The method for the `^` operator

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

#### `type Output = Mpz`

The resulting type after applying the `^` operator

#### `fn bitxor(self, other: Mpz) -> Mpz`

The method for the `^` operator

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

#### `type Output = Mpz`

The resulting type after applying the `^` operator

#### `fn bitxor(self, other: &Mpz) -> Mpz`

The method for the `^` operator

### `impl BitXorAssign<Mpz> for Mpz`[src]

#### `fn bitxor_assign(&mut self, other: Mpz)`

The method for the `^=` operator

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

#### `fn bitxor_assign(&mut self, other: &Mpz)`

The method for the `^=` operator

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

#### `type Output = Mpz`

The resulting type after applying the `<<` operator

#### `fn shl(self, other: usize) -> Mpz`

The method for the `<<` operator

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

#### `type Output = Mpz`

The resulting type after applying the `>>` operator

#### `fn shr(self, other: usize) -> Mpz`

The method for the `>>` operator

### `impl Shl<usize> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `<<` operator

#### `fn shl(self, other: usize) -> Mpz`

The method for the `<<` operator

### `impl Shr<usize> for Mpz`[src]

#### `type Output = Mpz`

The resulting type after applying the `>>` operator

#### `fn shr(self, other: usize) -> Mpz`

The method for the `>>` operator

### `impl ShlAssign<usize> for Mpz`[src]

#### `fn shl_assign(&mut self, other: usize)`

The method for the `<<=` operator

### `impl ShrAssign<usize> for Mpz`[src]

#### `fn shr_assign(&mut self, other: usize)`

The method for the `>>=` operator

### `impl FromStr for Mpz`[src]

#### `type Err = ParseMpzError`

The associated error which can be returned from parsing.

#### `fn from_str(s: &str) -> Result<Self, Self::Err>`

Parses a string `s` to return a value of this type. Read more

### `impl Display for Mpz`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter. Read more

### `impl Debug for Mpz`[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter.

### `impl Hash for Mpz`[src]

#### `fn hash<S: Hasher>(&self, state: &mut S)`

Feeds this value into the given [`Hasher`]. Read more

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where    H: Hasher, `1.3.0

Feeds a slice of this type into the given [`Hasher`]. Read more

### `impl Zero for Mpz`[src]

#### `fn zero() -> Mpz`

Returns the additive identity element of `Self`, `0`. Read more

#### `fn is_zero(&self) -> bool`

Returns `true` if `self` is equal to the additive identity.

### `impl One for Mpz`[src]

#### `fn one() -> Mpz`

Returns the multiplicative identity element of `Self`, `1`. Read more