[−][src]Struct num_rational::Ratio
Represents the ratio between two numbers.
Methods
impl<T: Clone + Integer> Ratio<T>[src]
impl<T: Clone + Integer> Ratio<T>pub fn new(numer: T, denom: T) -> Ratio<T>[src]
pub fn new(numer: T, denom: T) -> Ratio<T>Creates a new Ratio. Fails if denom is zero.
pub fn from_integer(t: T) -> Ratio<T>[src]
pub fn from_integer(t: T) -> Ratio<T>Creates a Ratio representing the integer t.
pub fn new_raw(numer: T, denom: T) -> Ratio<T>[src]
pub fn new_raw(numer: T, denom: T) -> Ratio<T>Creates a Ratio without checking for denom == 0 or reducing.
pub fn to_integer(&self) -> T[src]
pub fn to_integer(&self) -> TConverts to an integer, rounding towards zero.
pub fn numer<'a>(&'a self) -> &'a T[src]
pub fn numer<'a>(&'a self) -> &'a TGets an immutable reference to the numerator.
pub fn denom<'a>(&'a self) -> &'a T[src]
pub fn denom<'a>(&'a self) -> &'a TGets an immutable reference to the denominator.
pub fn is_integer(&self) -> bool[src]
pub fn is_integer(&self) -> boolReturns true if the rational number is an integer (denominator is 1).
pub fn reduced(&self) -> Ratio<T>[src]
pub fn reduced(&self) -> Ratio<T>Returns a reduced copy of self.
In general, it is not necessary to use this method, as the only
method of procuring a non-reduced fraction is through new_raw.
pub fn recip(&self) -> Ratio<T>[src]
pub fn recip(&self) -> Ratio<T>Returns the reciprocal.
Fails if the Ratio is zero.
pub fn floor(&self) -> Ratio<T>[src]
pub fn floor(&self) -> Ratio<T>Rounds towards minus infinity.
pub fn ceil(&self) -> Ratio<T>[src]
pub fn ceil(&self) -> Ratio<T>Rounds towards plus infinity.
pub fn round(&self) -> Ratio<T>[src]
pub fn round(&self) -> Ratio<T>Rounds to the nearest integer. Rounds half-way cases away from zero.
pub fn trunc(&self) -> Ratio<T>[src]
pub fn trunc(&self) -> Ratio<T>Rounds towards zero.
pub fn fract(&self) -> Ratio<T>[src]
pub fn fract(&self) -> Ratio<T>Returns the fractional part of a number, with division rounded towards zero.
Satisfies self == self.trunc() + self.fract().
impl<T: Clone + Integer + Pow<u32, Output = T>> Ratio<T>[src]
impl<T: Clone + Integer + Pow<u32, Output = T>> Ratio<T>impl Ratio<BigInt>[src]
impl Ratio<BigInt>pub fn from_float<T: FloatCore>(f: T) -> Option<BigRational>[src]
pub fn from_float<T: FloatCore>(f: T) -> Option<BigRational>Converts a float into a rational number.
impl<T: Integer + Signed + Bounded + NumCast + Clone> Ratio<T>[src]
impl<T: Integer + Signed + Bounded + NumCast + Clone> Ratio<T>Trait Implementations
impl<T: Clone + Integer> PartialEq<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer> PartialEq<Ratio<T>> for Ratio<T>fn eq(&self, other: &Self) -> bool[src]
fn eq(&self, other: &Self) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<T: Clone + Integer> Eq for Ratio<T>[src]
impl<T: Clone + Integer> Eq for Ratio<T>impl<T: Clone + Integer> Ord for Ratio<T>[src]
impl<T: Clone + Integer> Ord for Ratio<T>fn cmp(&self, other: &Self) -> Ordering[src]
fn cmp(&self, other: &Self) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl<T: Clone + Integer> PartialOrd<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer> PartialOrd<Ratio<T>> for Ratio<T>fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>This method returns an ordering between self and other values if one exists. Read more
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<T> Display for Ratio<T> where
T: Display + Eq + One, [src]
impl<T> Display for Ratio<T> where
T: Display + Eq + One, fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultRenders as numer/denom. If denom=1, renders as numer.
impl<T: Debug> Debug for Ratio<T>[src]
impl<T: Debug> Debug for Ratio<T>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'a, 'b, T: Clone + Integer> Div<&'b Ratio<T>> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Div<&'b Ratio<T>> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, other: &'b Ratio<T>) -> Ratio<T>[src]
fn div(self, other: &'b Ratio<T>) -> Ratio<T>Performs the / operation.
impl<'a, 'b, T: Clone + Integer> Div<&'b T> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Div<&'b T> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, other: &'b T) -> Ratio<T>[src]
fn div(self, other: &'b T) -> Ratio<T>Performs the / operation.
impl<'a, T> Div<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Div<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, other: Ratio<T>) -> Ratio<T>[src]
fn div(self, other: Ratio<T>) -> Ratio<T>Performs the / operation.
impl<'a, T> Div<T> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Div<T> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, other: T) -> Ratio<T>[src]
fn div(self, other: T) -> Ratio<T>Performs the / operation.
impl<'a, T> Div<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Div<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, other: &Ratio<T>) -> Ratio<T>[src]
fn div(self, other: &Ratio<T>) -> Ratio<T>Performs the / operation.
impl<'a, T> Div<&'a T> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Div<&'a T> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, other: &T) -> Ratio<T>[src]
fn div(self, other: &T) -> Ratio<T>Performs the / operation.
impl<T> Div<Ratio<T>> for Ratio<T> where
T: Clone + Integer, [src]
impl<T> Div<Ratio<T>> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, rhs: Ratio<T>) -> Ratio<T>[src]
fn div(self, rhs: Ratio<T>) -> Ratio<T>Performs the / operation.
impl<T> Div<T> for Ratio<T> where
T: Clone + Integer, [src]
impl<T> Div<T> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the / operator.
fn div(self, rhs: T) -> Ratio<T>[src]
fn div(self, rhs: T) -> Ratio<T>Performs the / operation.
impl<'a, 'b, T: Clone + Integer> Rem<&'b Ratio<T>> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Rem<&'b Ratio<T>> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, other: &'b Ratio<T>) -> Ratio<T>[src]
fn rem(self, other: &'b Ratio<T>) -> Ratio<T>Performs the % operation.
impl<'a, 'b, T: Clone + Integer> Rem<&'b T> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Rem<&'b T> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, other: &'b T) -> Ratio<T>[src]
fn rem(self, other: &'b T) -> Ratio<T>Performs the % operation.
impl<'a, T> Rem<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Rem<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, other: Ratio<T>) -> Ratio<T>[src]
fn rem(self, other: Ratio<T>) -> Ratio<T>Performs the % operation.
impl<'a, T> Rem<T> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Rem<T> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, other: T) -> Ratio<T>[src]
fn rem(self, other: T) -> Ratio<T>Performs the % operation.
impl<'a, T> Rem<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Rem<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, other: &Ratio<T>) -> Ratio<T>[src]
fn rem(self, other: &Ratio<T>) -> Ratio<T>Performs the % operation.
impl<'a, T> Rem<&'a T> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Rem<&'a T> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, other: &T) -> Ratio<T>[src]
fn rem(self, other: &T) -> Ratio<T>Performs the % operation.
impl<T: Clone + Integer> Rem<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer> Rem<Ratio<T>> for Ratio<T>type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, rhs: Ratio<T>) -> Ratio<T>[src]
fn rem(self, rhs: Ratio<T>) -> Ratio<T>Performs the % operation.
impl<T: Clone + Integer> Rem<T> for Ratio<T>[src]
impl<T: Clone + Integer> Rem<T> for Ratio<T>type Output = Ratio<T>
The resulting type after applying the % operator.
fn rem(self, rhs: T) -> Ratio<T>[src]
fn rem(self, rhs: T) -> Ratio<T>Performs the % operation.
impl<'a, 'b, T: Clone + Integer> Add<&'b Ratio<T>> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Add<&'b Ratio<T>> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, other: &'b Ratio<T>) -> Ratio<T>[src]
fn add(self, other: &'b Ratio<T>) -> Ratio<T>Performs the + operation.
impl<'a, 'b, T: Clone + Integer> Add<&'b T> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Add<&'b T> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, other: &'b T) -> Ratio<T>[src]
fn add(self, other: &'b T) -> Ratio<T>Performs the + operation.
impl<'a, T> Add<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Add<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, other: Ratio<T>) -> Ratio<T>[src]
fn add(self, other: Ratio<T>) -> Ratio<T>Performs the + operation.
impl<'a, T> Add<T> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Add<T> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, other: T) -> Ratio<T>[src]
fn add(self, other: T) -> Ratio<T>Performs the + operation.
impl<'a, T> Add<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Add<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, other: &Ratio<T>) -> Ratio<T>[src]
fn add(self, other: &Ratio<T>) -> Ratio<T>Performs the + operation.
impl<'a, T> Add<&'a T> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Add<&'a T> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, other: &T) -> Ratio<T>[src]
fn add(self, other: &T) -> Ratio<T>Performs the + operation.
impl<T: Clone + Integer> Add<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer> Add<Ratio<T>> for Ratio<T>type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, rhs: Ratio<T>) -> Ratio<T>[src]
fn add(self, rhs: Ratio<T>) -> Ratio<T>Performs the + operation.
impl<T: Clone + Integer> Add<T> for Ratio<T>[src]
impl<T: Clone + Integer> Add<T> for Ratio<T>type Output = Ratio<T>
The resulting type after applying the + operator.
fn add(self, rhs: T) -> Ratio<T>[src]
fn add(self, rhs: T) -> Ratio<T>Performs the + operation.
impl<'a, 'b, T: Clone + Integer> Sub<&'b Ratio<T>> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Sub<&'b Ratio<T>> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, other: &'b Ratio<T>) -> Ratio<T>[src]
fn sub(self, other: &'b Ratio<T>) -> Ratio<T>Performs the - operation.
impl<'a, 'b, T: Clone + Integer> Sub<&'b T> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Sub<&'b T> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, other: &'b T) -> Ratio<T>[src]
fn sub(self, other: &'b T) -> Ratio<T>Performs the - operation.
impl<'a, T> Sub<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Sub<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, other: Ratio<T>) -> Ratio<T>[src]
fn sub(self, other: Ratio<T>) -> Ratio<T>Performs the - operation.
impl<'a, T> Sub<T> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Sub<T> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, other: T) -> Ratio<T>[src]
fn sub(self, other: T) -> Ratio<T>Performs the - operation.
impl<'a, T> Sub<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Sub<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, other: &Ratio<T>) -> Ratio<T>[src]
fn sub(self, other: &Ratio<T>) -> Ratio<T>Performs the - operation.
impl<'a, T> Sub<&'a T> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Sub<&'a T> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, other: &T) -> Ratio<T>[src]
fn sub(self, other: &T) -> Ratio<T>Performs the - operation.
impl<T: Clone + Integer> Sub<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer> Sub<Ratio<T>> for Ratio<T>type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, rhs: Ratio<T>) -> Ratio<T>[src]
fn sub(self, rhs: Ratio<T>) -> Ratio<T>Performs the - operation.
impl<T: Clone + Integer> Sub<T> for Ratio<T>[src]
impl<T: Clone + Integer> Sub<T> for Ratio<T>type Output = Ratio<T>
The resulting type after applying the - operator.
fn sub(self, rhs: T) -> Ratio<T>[src]
fn sub(self, rhs: T) -> Ratio<T>Performs the - operation.
impl<'a, 'b, T: Clone + Integer> Mul<&'b Ratio<T>> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Mul<&'b Ratio<T>> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, other: &'b Ratio<T>) -> Ratio<T>[src]
fn mul(self, other: &'b Ratio<T>) -> Ratio<T>Performs the * operation.
impl<'a, 'b, T: Clone + Integer> Mul<&'b T> for &'a Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer> Mul<&'b T> for &'a Ratio<T>type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, other: &'b T) -> Ratio<T>[src]
fn mul(self, other: &'b T) -> Ratio<T>Performs the * operation.
impl<'a, T> Mul<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Mul<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, other: Ratio<T>) -> Ratio<T>[src]
fn mul(self, other: Ratio<T>) -> Ratio<T>Performs the * operation.
impl<'a, T> Mul<T> for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Mul<T> for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, other: T) -> Ratio<T>[src]
fn mul(self, other: T) -> Ratio<T>Performs the * operation.
impl<'a, T> Mul<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Mul<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, other: &Ratio<T>) -> Ratio<T>[src]
fn mul(self, other: &Ratio<T>) -> Ratio<T>Performs the * operation.
impl<'a, T> Mul<&'a T> for Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Mul<&'a T> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, other: &T) -> Ratio<T>[src]
fn mul(self, other: &T) -> Ratio<T>Performs the * operation.
impl<T> Mul<Ratio<T>> for Ratio<T> where
T: Clone + Integer, [src]
impl<T> Mul<Ratio<T>> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, rhs: Ratio<T>) -> Ratio<T>[src]
fn mul(self, rhs: Ratio<T>) -> Ratio<T>Performs the * operation.
impl<T> Mul<T> for Ratio<T> where
T: Clone + Integer, [src]
impl<T> Mul<T> for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The resulting type after applying the * operator.
fn mul(self, rhs: T) -> Ratio<T>[src]
fn mul(self, rhs: T) -> Ratio<T>Performs the * operation.
impl<T> Neg for Ratio<T> where
T: Clone + Integer + Neg<Output = T>, [src]
impl<T> Neg for Ratio<T> where
T: Clone + Integer + Neg<Output = T>, type Output = Ratio<T>
The resulting type after applying the - operator.
fn neg(self) -> Ratio<T>[src]
fn neg(self) -> Ratio<T>Performs the unary - operation.
impl<'a, T> Neg for &'a Ratio<T> where
T: Clone + Integer + Neg<Output = T>, [src]
impl<'a, T> Neg for &'a Ratio<T> where
T: Clone + Integer + Neg<Output = T>, type Output = Ratio<T>
The resulting type after applying the - operator.
fn neg(self) -> Ratio<T>[src]
fn neg(self) -> Ratio<T>Performs the unary - operation.
impl<T: Clone + Integer + NumAssign> AddAssign<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> AddAssign<Ratio<T>> for Ratio<T>fn add_assign(&mut self, other: Ratio<T>)[src]
fn add_assign(&mut self, other: Ratio<T>)Performs the += operation.
impl<T: Clone + Integer + NumAssign> AddAssign<T> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> AddAssign<T> for Ratio<T>fn add_assign(&mut self, other: T)[src]
fn add_assign(&mut self, other: T)Performs the += operation.
impl<'a, T: Clone + Integer + NumAssign> AddAssign<&'a Ratio<T>> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> AddAssign<&'a Ratio<T>> for Ratio<T>fn add_assign(&mut self, other: &Ratio<T>)[src]
fn add_assign(&mut self, other: &Ratio<T>)Performs the += operation.
impl<'a, T: Clone + Integer + NumAssign> AddAssign<&'a T> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> AddAssign<&'a T> for Ratio<T>fn add_assign(&mut self, other: &T)[src]
fn add_assign(&mut self, other: &T)Performs the += operation.
impl<T: Clone + Integer + NumAssign> SubAssign<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> SubAssign<Ratio<T>> for Ratio<T>fn sub_assign(&mut self, other: Ratio<T>)[src]
fn sub_assign(&mut self, other: Ratio<T>)Performs the -= operation.
impl<T: Clone + Integer + NumAssign> SubAssign<T> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> SubAssign<T> for Ratio<T>fn sub_assign(&mut self, other: T)[src]
fn sub_assign(&mut self, other: T)Performs the -= operation.
impl<'a, T: Clone + Integer + NumAssign> SubAssign<&'a Ratio<T>> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> SubAssign<&'a Ratio<T>> for Ratio<T>fn sub_assign(&mut self, other: &Ratio<T>)[src]
fn sub_assign(&mut self, other: &Ratio<T>)Performs the -= operation.
impl<'a, T: Clone + Integer + NumAssign> SubAssign<&'a T> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> SubAssign<&'a T> for Ratio<T>fn sub_assign(&mut self, other: &T)[src]
fn sub_assign(&mut self, other: &T)Performs the -= operation.
impl<T: Clone + Integer + NumAssign> MulAssign<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> MulAssign<Ratio<T>> for Ratio<T>fn mul_assign(&mut self, other: Ratio<T>)[src]
fn mul_assign(&mut self, other: Ratio<T>)Performs the *= operation.
impl<T: Clone + Integer + NumAssign> MulAssign<T> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> MulAssign<T> for Ratio<T>fn mul_assign(&mut self, other: T)[src]
fn mul_assign(&mut self, other: T)Performs the *= operation.
impl<'a, T: Clone + Integer + NumAssign> MulAssign<&'a Ratio<T>> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> MulAssign<&'a Ratio<T>> for Ratio<T>fn mul_assign(&mut self, other: &Ratio<T>)[src]
fn mul_assign(&mut self, other: &Ratio<T>)Performs the *= operation.
impl<'a, T: Clone + Integer + NumAssign> MulAssign<&'a T> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> MulAssign<&'a T> for Ratio<T>fn mul_assign(&mut self, other: &T)[src]
fn mul_assign(&mut self, other: &T)Performs the *= operation.
impl<T: Clone + Integer + NumAssign> DivAssign<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> DivAssign<Ratio<T>> for Ratio<T>fn div_assign(&mut self, other: Ratio<T>)[src]
fn div_assign(&mut self, other: Ratio<T>)Performs the /= operation.
impl<T: Clone + Integer + NumAssign> DivAssign<T> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> DivAssign<T> for Ratio<T>fn div_assign(&mut self, other: T)[src]
fn div_assign(&mut self, other: T)Performs the /= operation.
impl<'a, T: Clone + Integer + NumAssign> DivAssign<&'a Ratio<T>> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> DivAssign<&'a Ratio<T>> for Ratio<T>fn div_assign(&mut self, other: &Ratio<T>)[src]
fn div_assign(&mut self, other: &Ratio<T>)Performs the /= operation.
impl<'a, T: Clone + Integer + NumAssign> DivAssign<&'a T> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> DivAssign<&'a T> for Ratio<T>fn div_assign(&mut self, other: &T)[src]
fn div_assign(&mut self, other: &T)Performs the /= operation.
impl<T: Clone + Integer + NumAssign> RemAssign<Ratio<T>> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> RemAssign<Ratio<T>> for Ratio<T>fn rem_assign(&mut self, other: Ratio<T>)[src]
fn rem_assign(&mut self, other: Ratio<T>)Performs the %= operation.
impl<T: Clone + Integer + NumAssign> RemAssign<T> for Ratio<T>[src]
impl<T: Clone + Integer + NumAssign> RemAssign<T> for Ratio<T>fn rem_assign(&mut self, other: T)[src]
fn rem_assign(&mut self, other: T)Performs the %= operation.
impl<'a, T: Clone + Integer + NumAssign> RemAssign<&'a Ratio<T>> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> RemAssign<&'a Ratio<T>> for Ratio<T>fn rem_assign(&mut self, other: &Ratio<T>)[src]
fn rem_assign(&mut self, other: &Ratio<T>)Performs the %= operation.
impl<'a, T: Clone + Integer + NumAssign> RemAssign<&'a T> for Ratio<T>[src]
impl<'a, T: Clone + Integer + NumAssign> RemAssign<&'a T> for Ratio<T>fn rem_assign(&mut self, other: &T)[src]
fn rem_assign(&mut self, other: &T)Performs the %= operation.
impl<T: Clone + Integer + Hash> Hash for Ratio<T>[src]
impl<T: Clone + Integer + Hash> Hash for Ratio<T>fn hash<H: Hasher>(&self, state: &mut H)[src]
fn hash<H: Hasher>(&self, state: &mut H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<T: Integer + Clone> Sum<Ratio<T>> for Ratio<T>[src]
impl<T: Integer + Clone> Sum<Ratio<T>> for Ratio<T>fn sum<I>(iter: I) -> Self where
I: Iterator<Item = Ratio<T>>, [src]
fn sum<I>(iter: I) -> Self where
I: Iterator<Item = Ratio<T>>, Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more
impl<'a, T: Integer + Clone> Sum<&'a Ratio<T>> for Ratio<T>[src]
impl<'a, T: Integer + Clone> Sum<&'a Ratio<T>> for Ratio<T>fn sum<I>(iter: I) -> Self where
I: Iterator<Item = &'a Ratio<T>>, [src]
fn sum<I>(iter: I) -> Self where
I: Iterator<Item = &'a Ratio<T>>, Method which takes an iterator and generates Self from the elements by "summing up" the items. Read more
impl<T: Copy> Copy for Ratio<T>[src]
impl<T: Copy> Copy for Ratio<T>impl<T: Integer + Clone> Product<Ratio<T>> for Ratio<T>[src]
impl<T: Integer + Clone> Product<Ratio<T>> for Ratio<T>fn product<I>(iter: I) -> Self where
I: Iterator<Item = Ratio<T>>, [src]
fn product<I>(iter: I) -> Self where
I: Iterator<Item = Ratio<T>>, Method which takes an iterator and generates Self from the elements by multiplying the items. Read more
impl<'a, T: Integer + Clone> Product<&'a Ratio<T>> for Ratio<T>[src]
impl<'a, T: Integer + Clone> Product<&'a Ratio<T>> for Ratio<T>fn product<I>(iter: I) -> Self where
I: Iterator<Item = &'a Ratio<T>>, [src]
fn product<I>(iter: I) -> Self where
I: Iterator<Item = &'a Ratio<T>>, Method which takes an iterator and generates Self from the elements by multiplying the items. Read more
impl<T: FromStr + Clone + Integer> FromStr for Ratio<T>[src]
impl<T: FromStr + Clone + Integer> FromStr for Ratio<T>type Err = ParseRatioError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Ratio<T>, ParseRatioError>[src]
fn from_str(s: &str) -> Result<Ratio<T>, ParseRatioError>Parses numer/denom or just numer.
impl<T> From<T> for Ratio<T> where
T: Clone + Integer, [src]
impl<T> From<T> for Ratio<T> where
T: Clone + Integer, impl<T> From<(T, T)> for Ratio<T> where
T: Clone + Integer, [src]
impl<T> From<(T, T)> for Ratio<T> where
T: Clone + Integer, impl<T: Clone> Clone for Ratio<T>[src]
impl<T: Clone> Clone for Ratio<T>fn clone(&self) -> Ratio<T>[src]
fn clone(&self) -> Ratio<T>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<T> Into<(T, T)> for Ratio<T>[src]
impl<T> Into<(T, T)> for Ratio<T>impl<T: Clone + Integer> Zero for Ratio<T>[src]
impl<T: Clone + Integer> Zero for Ratio<T>fn zero() -> Ratio<T>[src]
fn zero() -> Ratio<T>Returns the additive identity element of Self, 0. Read more
fn is_zero(&self) -> bool[src]
fn is_zero(&self) -> boolReturns true if self is equal to the additive identity.
impl FromPrimitive for Ratio<BigInt>[src]
impl FromPrimitive for Ratio<BigInt>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<i8>[src]
impl FromPrimitive for Ratio<i8>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<i16>[src]
impl FromPrimitive for Ratio<i16>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<i32>[src]
impl FromPrimitive for Ratio<i32>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<i64>[src]
impl FromPrimitive for Ratio<i64>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<i128>[src]
impl FromPrimitive for Ratio<i128>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<isize>[src]
impl FromPrimitive for Ratio<isize>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<u8>[src]
impl FromPrimitive for Ratio<u8>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<u16>[src]
impl FromPrimitive for Ratio<u16>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<u32>[src]
impl FromPrimitive for Ratio<u32>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<u64>[src]
impl FromPrimitive for Ratio<u64>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<u128>[src]
impl FromPrimitive for Ratio<u128>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl FromPrimitive for Ratio<usize>[src]
impl FromPrimitive for Ratio<usize>fn from_i64(n: i64) -> Option<Self>[src]
fn from_i64(n: i64) -> Option<Self>Convert an i64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i128(n: i128) -> Option<Self>[src]
fn from_i128(n: i128) -> Option<Self>Convert an i128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u64(n: u64) -> Option<Self>[src]
fn from_u64(n: u64) -> Option<Self>Convert an u64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u128(n: u128) -> Option<Self>[src]
fn from_u128(n: u128) -> Option<Self>Convert an u128 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f32(n: f32) -> Option<Self>[src]
fn from_f32(n: f32) -> Option<Self>Convert a f32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_f64(n: f64) -> Option<Self>[src]
fn from_f64(n: f64) -> Option<Self>Convert a f64 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_isize(n: isize) -> Option<Self>[src]
fn from_isize(n: isize) -> Option<Self>Convert an isize to return an optional value of this type. If the value cannot be represented by this value, then None is returned. Read more
fn from_i8(n: i8) -> Option<Self>[src]
fn from_i8(n: i8) -> Option<Self>Convert an i8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i16(n: i16) -> Option<Self>[src]
fn from_i16(n: i16) -> Option<Self>Convert an i16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_i32(n: i32) -> Option<Self>[src]
fn from_i32(n: i32) -> Option<Self>Convert an i32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_usize(n: usize) -> Option<Self>[src]
fn from_usize(n: usize) -> Option<Self>Convert a usize to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u8(n: u8) -> Option<Self>[src]
fn from_u8(n: u8) -> Option<Self>Convert an u8 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u16(n: u16) -> Option<Self>[src]
fn from_u16(n: u16) -> Option<Self>Convert an u16 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
fn from_u32(n: u32) -> Option<Self>[src]
fn from_u32(n: u32) -> Option<Self>Convert an u32 to return an optional value of this type. If the type cannot be represented by this value, then None is returned. Read more
impl<T: Clone + Integer> Num for Ratio<T>[src]
impl<T: Clone + Integer> Num for Ratio<T>type FromStrRadixErr = ParseRatioError
fn from_str_radix(s: &str, radix: u32) -> Result<Ratio<T>, ParseRatioError>[src]
fn from_str_radix(s: &str, radix: u32) -> Result<Ratio<T>, ParseRatioError>Parses numer/denom where the numbers are in base radix.
impl<T: Clone + Integer> One for Ratio<T>[src]
impl<T: Clone + Integer> One for Ratio<T>fn one() -> Ratio<T>[src]
fn one() -> Ratio<T>Returns the multiplicative identity element of Self, 1. Read more
fn is_one(&self) -> bool[src]
fn is_one(&self) -> boolReturns true if self is equal to the multiplicative identity. Read more
impl<T: Clone + Integer + CheckedMul + CheckedAdd> CheckedAdd for Ratio<T>[src]
impl<T: Clone + Integer + CheckedMul + CheckedAdd> CheckedAdd for Ratio<T>fn checked_add(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>[src]
fn checked_add(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>Adds two numbers, checking for overflow. If overflow happens, None is returned. Read more
impl<T> CheckedDiv for Ratio<T> where
T: Clone + Integer + CheckedMul, [src]
impl<T> CheckedDiv for Ratio<T> where
T: Clone + Integer + CheckedMul, fn checked_div(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>[src]
fn checked_div(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, None is returned. Read more
impl<T: Clone + Integer + CheckedMul + CheckedSub> CheckedSub for Ratio<T>[src]
impl<T: Clone + Integer + CheckedMul + CheckedSub> CheckedSub for Ratio<T>fn checked_sub(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>[src]
fn checked_sub(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>Subtracts two numbers, checking for underflow. If underflow happens, None is returned. Read more
impl<T> CheckedMul for Ratio<T> where
T: Clone + Integer + CheckedMul, [src]
impl<T> CheckedMul for Ratio<T> where
T: Clone + Integer + CheckedMul, fn checked_mul(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>[src]
fn checked_mul(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>Multiplies two numbers, checking for underflow or overflow. If underflow or overflow happens, None is returned. Read more
impl<T> Inv for Ratio<T> where
T: Clone + Integer, [src]
impl<T> Inv for Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The result after applying the operator.
fn inv(self) -> Ratio<T>[src]
fn inv(self) -> Ratio<T>Returns the multiplicative inverse of self. Read more
impl<'a, T> Inv for &'a Ratio<T> where
T: Clone + Integer, [src]
impl<'a, T> Inv for &'a Ratio<T> where
T: Clone + Integer, type Output = Ratio<T>
The result after applying the operator.
fn inv(self) -> Ratio<T>[src]
fn inv(self) -> Ratio<T>Returns the multiplicative inverse of self. Read more
impl<T: Clone + Integer + Pow<u8, Output = T>> Pow<i8> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u8, Output = T>> Pow<i8> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i8) -> Ratio<T>[src]
fn pow(self, expon: i8) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<i8> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<i8> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i8) -> Ratio<T>[src]
fn pow(self, expon: i8) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a i8> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a i8> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i8) -> Ratio<T>[src]
fn pow(self, expon: &'a i8) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a i8> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a i8> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i8) -> Ratio<T>[src]
fn pow(self, expon: &'a i8) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<u16, Output = T>> Pow<i16> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u16, Output = T>> Pow<i16> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i16) -> Ratio<T>[src]
fn pow(self, expon: i16) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<i16> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<i16> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i16) -> Ratio<T>[src]
fn pow(self, expon: i16) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a i16> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a i16> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i16) -> Ratio<T>[src]
fn pow(self, expon: &'a i16) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a i16> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a i16> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i16) -> Ratio<T>[src]
fn pow(self, expon: &'a i16) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<u32, Output = T>> Pow<i32> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u32, Output = T>> Pow<i32> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i32) -> Ratio<T>[src]
fn pow(self, expon: i32) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<i32> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<i32> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i32) -> Ratio<T>[src]
fn pow(self, expon: i32) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a i32> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a i32> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i32) -> Ratio<T>[src]
fn pow(self, expon: &'a i32) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a i32> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a i32> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i32) -> Ratio<T>[src]
fn pow(self, expon: &'a i32) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<u64, Output = T>> Pow<i64> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u64, Output = T>> Pow<i64> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i64) -> Ratio<T>[src]
fn pow(self, expon: i64) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<i64> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<i64> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: i64) -> Ratio<T>[src]
fn pow(self, expon: i64) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a i64> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a i64> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i64) -> Ratio<T>[src]
fn pow(self, expon: &'a i64) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a i64> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a i64> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a i64) -> Ratio<T>[src]
fn pow(self, expon: &'a i64) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<usize, Output = T>> Pow<isize> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<usize, Output = T>> Pow<isize> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: isize) -> Ratio<T>[src]
fn pow(self, expon: isize) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<isize> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<isize> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: isize) -> Ratio<T>[src]
fn pow(self, expon: isize) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a isize> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a isize> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a isize) -> Ratio<T>[src]
fn pow(self, expon: &'a isize) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a isize> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a isize> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a isize) -> Ratio<T>[src]
fn pow(self, expon: &'a isize) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<u8, Output = T>> Pow<u8> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u8, Output = T>> Pow<u8> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u8) -> Ratio<T>[src]
fn pow(self, expon: u8) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<u8> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<u8> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u8) -> Ratio<T>[src]
fn pow(self, expon: u8) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a u8> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a u8> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u8) -> Ratio<T>[src]
fn pow(self, expon: &'a u8) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a u8> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'a u8> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u8) -> Ratio<T>[src]
fn pow(self, expon: &'a u8) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<u16, Output = T>> Pow<u16> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u16, Output = T>> Pow<u16> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u16) -> Ratio<T>[src]
fn pow(self, expon: u16) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<u16> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<u16> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u16) -> Ratio<T>[src]
fn pow(self, expon: u16) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a u16> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a u16> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u16) -> Ratio<T>[src]
fn pow(self, expon: &'a u16) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a u16> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'a u16> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u16) -> Ratio<T>[src]
fn pow(self, expon: &'a u16) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<u32, Output = T>> Pow<u32> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u32, Output = T>> Pow<u32> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u32) -> Ratio<T>[src]
fn pow(self, expon: u32) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<u32> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<u32> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u32) -> Ratio<T>[src]
fn pow(self, expon: u32) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a u32> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a u32> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u32) -> Ratio<T>[src]
fn pow(self, expon: &'a u32) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a u32> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'a u32> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u32) -> Ratio<T>[src]
fn pow(self, expon: &'a u32) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<u64, Output = T>> Pow<u64> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<u64, Output = T>> Pow<u64> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u64) -> Ratio<T>[src]
fn pow(self, expon: u64) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<u64> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<u64> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: u64) -> Ratio<T>[src]
fn pow(self, expon: u64) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a u64> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a u64> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u64) -> Ratio<T>[src]
fn pow(self, expon: &'a u64) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a u64> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'a u64> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a u64) -> Ratio<T>[src]
fn pow(self, expon: &'a u64) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Pow<usize, Output = T>> Pow<usize> for Ratio<T>[src]
impl<T: Clone + Integer + Pow<usize, Output = T>> Pow<usize> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: usize) -> Ratio<T>[src]
fn pow(self, expon: usize) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<usize> for &'a Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<usize> for &'a Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: usize) -> Ratio<T>[src]
fn pow(self, expon: usize) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a usize> for Ratio<T>[src]
impl<'a, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a usize> for Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a usize) -> Ratio<T>[src]
fn pow(self, expon: &'a usize) -> Ratio<T>Returns self to the power rhs. Read more
impl<'a, 'b, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a usize> for &'b Ratio<T>[src]
impl<'a, 'b, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'a usize> for &'b Ratio<T>type Output = Ratio<T>
The result after applying the operator.
fn pow(self, expon: &'a usize) -> Ratio<T>[src]
fn pow(self, expon: &'a usize) -> Ratio<T>Returns self to the power rhs. Read more
impl<T: Clone + Integer + Signed> Signed for Ratio<T>[src]
impl<T: Clone + Integer + Signed> Signed for Ratio<T>fn abs(&self) -> Ratio<T>[src]
fn abs(&self) -> Ratio<T>Computes the absolute value. Read more
fn abs_sub(&self, other: &Ratio<T>) -> Ratio<T>[src]
fn abs_sub(&self, other: &Ratio<T>) -> Ratio<T>The positive difference of two numbers. Read more
fn signum(&self) -> Ratio<T>[src]
fn signum(&self) -> Ratio<T>Returns the sign of the number. Read more
fn is_positive(&self) -> bool[src]
fn is_positive(&self) -> boolReturns true if the number is positive and false if the number is zero or negative.
fn is_negative(&self) -> bool[src]
fn is_negative(&self) -> boolReturns true if the number is negative and false if the number is zero or positive.
Auto Trait Implementations
Blanket Implementations
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T, Rhs, Output> NumOps 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, Rhs, Output> NumOps for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, impl<T> NumRef for T where
T: Num + NumOps<&'r T, T>, [src]
impl<T> NumRef for T where
T: Num + NumOps<&'r T, T>, impl<T, Base> RefNum for T where
T: NumOps<Base, Base> + NumOps<&'r Base, Base>, [src]
impl<T, Base> RefNum for T where
T: NumOps<Base, Base> + NumOps<&'r Base, Base>, impl<T, Rhs> NumAssignOps for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, [src]
impl<T, Rhs> NumAssignOps for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>, impl<T> NumAssign for T where
T: Num + NumAssignOps<T>, [src]
impl<T> NumAssign for T where
T: Num + NumAssignOps<T>, impl<T> NumAssignRef for T where
T: NumAssign + NumAssignOps<&'r T>, [src]
impl<T> NumAssignRef for T where
T: NumAssign + NumAssignOps<&'r T>, impl<T> ToString for T where
T: Display + ?Sized, [src]
impl<T> ToString for T where
T: Display + ?Sized, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more