Struct gmp::mpq::Mpq
[−]
[src]
pub struct Mpq { /* fields omitted */ }
Methods
impl Mpq
[src]
unsafe fn inner(&self) -> mpq_srcptr
unsafe fn inner_mut(&mut self) -> mpq_ptr
fn new() -> Mpq
fn ratio(num: &Mpz, den: &Mpz) -> Mpq
fn canonicalize(&mut self)
fn from_str_radix(s: &str, base: u8) -> Result<Mpq, ParseMpqError>
fn set(&mut self, other: &Mpq)
fn set_z(&mut self, other: &Mpz)
fn set_d(&mut self, other: f64)
fn set_f(&mut self, other: &Mpf)
fn get_num(&self) -> Mpz
fn get_den(&self) -> Mpz
fn abs(&self) -> Mpq
fn invert(&self) -> Mpq
fn floor(&self) -> Mpz
fn ceil(&self) -> Mpz
fn one() -> Mpq
fn zero() -> Mpq
fn is_zero(&self) -> bool
Trait Implementations
impl Send for Mpq
[src]
impl Sync for Mpq
[src]
impl Drop for Mpq
[src]
impl Clone for Mpq
[src]
fn clone(&self) -> Mpq
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 Mpq
[src]
impl PartialEq for Mpq
[src]
fn eq(&self, other: &Mpq) -> 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 Mpq
[src]
fn cmp(&self, other: &Mpq) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialOrd for Mpq
[src]
fn partial_cmp(&self, other: &Mpq) -> 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<Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the +
operator
fn add(self, other: Mpq) -> Mpq
The method for the +
operator
impl<'a> Add<&'a Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the +
operator
fn add(self, other: &Mpq) -> Mpq
The method for the +
operator
impl<'a> Add<Mpq> for &'a Mpq
[src]
type Output = Mpq
The resulting type after applying the +
operator
fn add(self, other: Mpq) -> Mpq
The method for the +
operator
impl<'a, 'b> Add<&'a Mpq> for &'b Mpq
[src]
type Output = Mpq
The resulting type after applying the +
operator
fn add(self, other: &Mpq) -> Mpq
The method for the +
operator
impl<'a> AddAssign<Mpq> for Mpq
[src]
fn add_assign(&mut self, other: Mpq)
The method for the +=
operator
impl<'a> AddAssign<&'a Mpq> for Mpq
[src]
fn add_assign(&mut self, other: &Mpq)
The method for the +=
operator
impl Sub<Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the -
operator
fn sub(self, other: Mpq) -> Mpq
The method for the -
operator
impl<'a> Sub<&'a Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the -
operator
fn sub(self, other: &Mpq) -> Mpq
The method for the -
operator
impl<'a> Sub<Mpq> for &'a Mpq
[src]
type Output = Mpq
The resulting type after applying the -
operator
fn sub(self, other: Mpq) -> Mpq
The method for the -
operator
impl<'a, 'b> Sub<&'a Mpq> for &'b Mpq
[src]
type Output = Mpq
The resulting type after applying the -
operator
fn sub(self, other: &Mpq) -> Mpq
The method for the -
operator
impl<'a> SubAssign<Mpq> for Mpq
[src]
fn sub_assign(&mut self, other: Mpq)
The method for the -=
operator
impl<'a> SubAssign<&'a Mpq> for Mpq
[src]
fn sub_assign(&mut self, other: &Mpq)
The method for the -=
operator
impl Mul<Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the *
operator
fn mul(self, other: Mpq) -> Mpq
The method for the *
operator
impl<'a> Mul<&'a Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the *
operator
fn mul(self, other: &Mpq) -> Mpq
The method for the *
operator
impl<'a> Mul<Mpq> for &'a Mpq
[src]
type Output = Mpq
The resulting type after applying the *
operator
fn mul(self, other: Mpq) -> Mpq
The method for the *
operator
impl<'a, 'b> Mul<&'a Mpq> for &'b Mpq
[src]
type Output = Mpq
The resulting type after applying the *
operator
fn mul(self, other: &Mpq) -> Mpq
The method for the *
operator
impl<'a> MulAssign<Mpq> for Mpq
[src]
fn mul_assign(&mut self, other: Mpq)
The method for the *=
operator
impl<'a> MulAssign<&'a Mpq> for Mpq
[src]
fn mul_assign(&mut self, other: &Mpq)
The method for the *=
operator
impl Div<Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the /
operator
fn div(self, other: Mpq) -> Mpq
The method for the /
operator
impl<'a> Div<&'a Mpq> for Mpq
[src]
type Output = Mpq
The resulting type after applying the /
operator
fn div(self, other: &Mpq) -> Mpq
The method for the /
operator
impl<'a> Div<Mpq> for &'a Mpq
[src]
type Output = Mpq
The resulting type after applying the /
operator
fn div(self, other: Mpq) -> Mpq
The method for the /
operator
impl<'a, 'b> Div<&'a Mpq> for &'b Mpq
[src]
type Output = Mpq
The resulting type after applying the /
operator
fn div(self, other: &Mpq) -> Mpq
The method for the /
operator
impl<'a> DivAssign<Mpq> for Mpq
[src]
fn div_assign(&mut self, other: Mpq)
The method for the /=
operator
impl<'a> DivAssign<&'a Mpq> for Mpq
[src]
fn div_assign(&mut self, other: &Mpq)
The method for the /=
operator
impl<'b> Neg for &'b Mpq
[src]
type Output = Mpq
The resulting type after applying the -
operator
fn neg(self) -> Mpq
The method for the unary -
operator
impl Neg for Mpq
[src]
type Output = Mpq
The resulting type after applying the -
operator
fn neg(self) -> Mpq
The method for the unary -
operator
impl From<Mpz> for Mpq
[src]
impl<'a> From<&'a Mpz> for Mpq
[src]
impl From<i64> for Mpq
[src]
impl From<i32> for Mpq
[src]
impl From<u64> for Mpq
[src]
impl From<u32> for Mpq
[src]
impl FromStr for Mpq
[src]
type Err = ParseMpqError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Mpq, ParseMpqError>
Parses a string s
to return a value of this type. Read more
impl Debug for Mpq
[src]
impl Display for Mpq
[src]
impl Zero for Mpq
[src]
fn zero() -> Mpq
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.