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

pub struct Mpz { /* fields omitted */ }

## Methods

`impl Mpz`

[src]

`unsafe fn inner(&self) -> mpz_srcptr`

`unsafe fn inner_mut(&mut self) -> mpz_ptr`

`fn new() -> Mpz`

`fn new_reserve(n: usize) -> Mpz`

`fn reserve(&mut self, n: usize)`

`fn to_str_radix(&self, base: u8) -> String`

`fn from_str_radix(s: &str, base: u8) -> Result<Mpz, ()>`

`fn set(&mut self, other: &Mpz)`

`fn set_from_str_radix(&mut self, s: &str, base: u8) -> bool`

`fn bit_length(&self) -> usize`

`fn compl(&self) -> Mpz`

`fn abs(&self) -> Mpz`

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

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

`fn nextprime(&self) -> Mpz`

`fn probab_prime_p(&self, reps: i32) -> bool`

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

`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.

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

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

`fn legendre(&self, other: &Mpz) -> i8`

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

`fn modulus(&self, modulo: &Mpz) -> Mpz`

`fn invert(&self, modulo: &Mpz) -> Option<Mpz>`

`fn popcount(&self) -> usize`

`fn pow(&self, exp: u32) -> Mpz`

`fn powm(&self, exp: &Mpz, modulus: &Mpz) -> Mpz`

`fn ui_pow_ui(x: u32, y: u32) -> Mpz`

`fn hamdist(&self, other: &Mpz) -> usize`

`fn setbit(&mut self, bit_index: usize)`

`fn clrbit(&mut self, bit_index: usize)`

`fn combit(&mut self, bit_index: usize)`

`fn tstbit(&self, bit_index: usize) -> bool`

`fn root(&self, n: u32) -> Mpz`

`fn sqrt(&self) -> Mpz`

`fn millerrabin(&self, reps: i32) -> i32`

`fn one() -> Mpz`

`fn zero() -> Mpz`

`fn is_zero(&self) -> bool`

## Trait Implementations

`impl Send for Mpz`

[src]

`impl Drop for Mpz`

[src]

`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 Eq for Mpz`

[src]

`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 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 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 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 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 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 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 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 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 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 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<'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> Into<Vec<u8>> for &'b Mpz`

[src]

`impl<'b> Into<Option<i64>> for &'b Mpz`

[src]

`impl<'b> Into<Option<u64>> for &'b Mpz`

[src]

`impl<'a> Into<f64> for &'a Mpz`

[src]

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

[src]

`impl From<u64> for Mpz`

[src]

`impl From<u32> for Mpz`

[src]

`impl From<i64> for Mpz`

[src]

`impl From<i32> for Mpz`

[src]

`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 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 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<'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 FromStr for Mpz`

[src]

`type Err = ()`

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