# Struct num_rational::Ratio

``pub struct Ratio<T> { /* private fields */ }``
Expand description

Represents the ratio between two numbers.

## Implementations§

source§

### impl<T> Ratio<T>

These method are `const` for Rust 1.31 and later.

source

#### pub const fn new_raw(numer: T, denom: T) -> Ratio<T>

Creates a `Ratio` without checking for `denom == 0` or reducing.

There are several methods that will panic if used on a `Ratio` with `denom == 0`.

source

#### pub const fn numer(&self) -> &T

Gets an immutable reference to the numerator.

source

#### pub const fn denom(&self) -> &T

Gets an immutable reference to the denominator.

source§

### impl<T: Clone + Integer> Ratio<T>

source

#### pub fn new(numer: T, denom: T) -> Ratio<T>

Creates a new `Ratio`.

Panics if `denom` is zero.

source

#### pub fn from_integer(t: T) -> Ratio<T>

Creates a `Ratio` representing the integer `t`.

source

#### pub fn to_integer(&self) -> T

Converts to an integer, rounding towards zero.

source

#### pub fn is_integer(&self) -> bool

Returns true if the rational number is an integer (denominator is 1).

source

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

Panics if `denom` is zero.

source

#### pub fn recip(&self) -> Ratio<T>

Returns the reciprocal.

Panics if the `Ratio` is zero.

source

#### pub fn floor(&self) -> Ratio<T>

Rounds towards minus infinity.

source

#### pub fn ceil(&self) -> Ratio<T>

Rounds towards plus infinity.

source

#### pub fn round(&self) -> Ratio<T>

Rounds to the nearest integer. Rounds half-way cases away from zero.

source

#### pub fn trunc(&self) -> Ratio<T>

Rounds towards zero.

source

#### pub fn fract(&self) -> Ratio<T>

Returns the fractional part of a number, with division rounded towards zero.

Satisfies `self == self.trunc() + self.fract()`.

source

#### pub fn pow(&self, expon: i32) -> Ratio<T>where for<'a> &'a T: Pow<u32, Output = T>,

Raises the `Ratio` to the power of an exponent.

source§

### impl Ratio<BigInt>

source

#### pub fn from_float<T: FloatCore>(f: T) -> Option<BigRational>

Converts a float into a rational number.

source§

source

## Trait Implementations§

source§

### 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.
source§

#### fn add(self, other: &'b Ratio<T>) -> Ratio<T>

Performs the `+` operation. Read more
source§

### 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.
source§

#### fn add(self, other: &Ratio<T>) -> Ratio<T>

Performs the `+` operation. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Add<&'b T> for &'a Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `+` operator.
source§

#### fn add(self, other: &'b T) -> Ratio<T>

Performs the `+` operation. Read more
source§

### impl<'a, T> Add<&'a T> for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `+` operator.
source§

#### fn add(self, other: &T) -> Ratio<T>

Performs the `+` operation. Read more
source§

### 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.
source§

#### fn add(self, other: Ratio<T>) -> Ratio<T>

Performs the `+` operation. Read more
source§

### impl<'a, T> Add<T> for &'a Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `+` operator.
source§

#### fn add(self, other: T) -> Ratio<T>

Performs the `+` operation. Read more
source§

### impl<T: Clone + Integer> Add<T> for Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `+` operator.
source§

#### fn add(self, rhs: T) -> Ratio<T>

Performs the `+` operation. Read more
source§

### impl<T: Clone + Integer> Add for Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `+` operator.
source§

#### fn add(self, rhs: Ratio<T>) -> Ratio<T>

Performs the `+` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> AddAssign<&'a Ratio<T>> for Ratio<T>

source§

#### fn add_assign(&mut self, other: &Ratio<T>)

Performs the `+=` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> AddAssign<&'a T> for Ratio<T>

source§

#### fn add_assign(&mut self, other: &T)

Performs the `+=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> AddAssign<T> for Ratio<T>

source§

#### fn add_assign(&mut self, other: T)

Performs the `+=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> AddAssign for Ratio<T>

source§

#### fn add_assign(&mut self, other: Ratio<T>)

Performs the `+=` operation. Read more
source§

### impl<T: Binary + Clone + Integer> Binary for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

### impl<T: Clone + Integer + CheckedMul + CheckedAdd> CheckedAdd for Ratio<T>

source§

#### fn checked_add(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>

Adds two numbers, checking for overflow. If overflow happens, `None` is returned.
source§

### impl<T> CheckedDiv for Ratio<T>where T: Clone + Integer + CheckedMul,

source§

#### 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.
source§

### impl<T> CheckedMul for Ratio<T>where T: Clone + Integer + CheckedMul,

source§

#### 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.
source§

### impl<T: Clone + Integer + CheckedMul + CheckedSub> CheckedSub for Ratio<T>

source§

#### fn checked_sub(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>

Subtracts two numbers, checking for underflow. If underflow happens, `None` is returned.
source§

### impl<T: Clone> Clone for Ratio<T>

source§

#### fn clone(&self) -> Ratio<T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from `source`. Read more
source§

### impl<T: Debug> Debug for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

### impl<T: Display + Clone + Integer> Display for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

### 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.
source§

#### fn div(self, other: &'b Ratio<T>) -> Ratio<T>

Performs the `/` operation. Read more
source§

### 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.
source§

#### fn div(self, other: &Ratio<T>) -> Ratio<T>

Performs the `/` operation. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Div<&'b T> for &'a Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `/` operator.
source§

#### fn div(self, other: &'b T) -> Ratio<T>

Performs the `/` operation. Read more
source§

### impl<'a, T> Div<&'a T> for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `/` operator.
source§

#### fn div(self, other: &T) -> Ratio<T>

Performs the `/` operation. Read more
source§

### 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.
source§

#### fn div(self, other: Ratio<T>) -> Ratio<T>

Performs the `/` operation. Read more
source§

### impl<'a, T> Div<T> for &'a Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `/` operator.
source§

#### fn div(self, other: T) -> Ratio<T>

Performs the `/` operation. Read more
source§

### impl<T> Div<T> for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `/` operator.
source§

#### fn div(self, rhs: T) -> Ratio<T>

Performs the `/` operation. Read more
source§

### impl<T> Div for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `/` operator.
source§

#### fn div(self, rhs: Ratio<T>) -> Ratio<T>

Performs the `/` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> DivAssign<&'a Ratio<T>> for Ratio<T>

source§

#### fn div_assign(&mut self, other: &Ratio<T>)

Performs the `/=` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> DivAssign<&'a T> for Ratio<T>

source§

#### fn div_assign(&mut self, other: &T)

Performs the `/=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> DivAssign<T> for Ratio<T>

source§

#### fn div_assign(&mut self, other: T)

Performs the `/=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> DivAssign for Ratio<T>

source§

#### fn div_assign(&mut self, other: Ratio<T>)

Performs the `/=` operation. Read more
source§

### impl<T> From<(T, T)> for Ratio<T>where T: Clone + Integer,

source§

#### fn from(pair: (T, T)) -> Ratio<T>

Converts to this type from the input type.
source§

### impl<T> From<T> for Ratio<T>where T: Clone + Integer,

source§

#### fn from(x: T) -> Ratio<T>

Converts to this type from the input type.
source§

### impl FromPrimitive for Ratio<BigInt>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<i128>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<i16>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<i32>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<i64>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<i8>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<isize>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<u128>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<u16>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<u32>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<u64>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<u8>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl FromPrimitive for Ratio<usize>

source§

#### fn from_i64(n: i64) -> Option<Self>

Converts an `i64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i128(n: i128) -> Option<Self>

Converts an `i128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_u64(n: u64) -> Option<Self>

Converts an `u64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u128(n: u128) -> Option<Self>

Converts an `u128` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_f32(n: f32) -> Option<Self>

Converts a `f32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_f64(n: f64) -> Option<Self>

Converts a `f64` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned. Read more
source§

#### fn from_isize(n: isize) -> Option<Self>

Converts an `isize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i8(n: i8) -> Option<Self>

Converts an `i8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i16(n: i16) -> Option<Self>

Converts an `i16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_i32(n: i32) -> Option<Self>

Converts an `i32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_usize(n: usize) -> Option<Self>

Converts a `usize` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u8(n: u8) -> Option<Self>

Converts an `u8` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u16(n: u16) -> Option<Self>

Converts an `u16` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

#### fn from_u32(n: u32) -> Option<Self>

Converts an `u32` to return an optional value of this type. If the value cannot be represented by this type, then `None` is returned.
source§

### impl<T: FromStr + Clone + Integer> FromStr for Ratio<T>

source§

#### fn from_str(s: &str) -> Result<Ratio<T>, ParseRatioError>

Parses `numer/denom` or just `numer`.

§

#### type Err = ParseRatioError

The associated error which can be returned from parsing.
source§

### impl<T: Clone + Integer + Hash> Hash for Ratio<T>

source§

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

Feeds this value into the given `Hasher`. Read more
1.3.0 · source§

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

Feeds a slice of this type into the given `Hasher`. Read more
source§

### impl<T> Into<(T, T)> for Ratio<T>

source§

#### fn into(self) -> (T, T)

Converts this type into the (usually inferred) input type.
source§

### impl<'a, T> Inv for &'a Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn inv(self) -> Ratio<T>

Returns the multiplicative inverse of `self`. Read more
source§

### impl<T> Inv for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn inv(self) -> Ratio<T>

Returns the multiplicative inverse of `self`. Read more
source§

### impl<T: LowerExp + Clone + Integer> LowerExp for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

### impl<T: LowerHex + Clone + Integer> LowerHex for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

### 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.
source§

#### fn mul(self, other: &'b Ratio<T>) -> Ratio<T>

Performs the `*` operation. Read more
source§

### 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.
source§

#### fn mul(self, other: &Ratio<T>) -> Ratio<T>

Performs the `*` operation. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Mul<&'b T> for &'a Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `*` operator.
source§

#### fn mul(self, other: &'b T) -> Ratio<T>

Performs the `*` operation. Read more
source§

### impl<'a, T> Mul<&'a T> for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `*` operator.
source§

#### fn mul(self, other: &T) -> Ratio<T>

Performs the `*` operation. Read more
source§

### 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.
source§

#### fn mul(self, other: Ratio<T>) -> Ratio<T>

Performs the `*` operation. Read more
source§

### impl<'a, T> Mul<T> for &'a Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `*` operator.
source§

#### fn mul(self, other: T) -> Ratio<T>

Performs the `*` operation. Read more
source§

### impl<T> Mul<T> for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `*` operator.
source§

#### fn mul(self, rhs: T) -> Ratio<T>

Performs the `*` operation. Read more
source§

### impl<T> Mul for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `*` operator.
source§

#### fn mul(self, rhs: Ratio<T>) -> Ratio<T>

Performs the `*` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> MulAssign<&'a Ratio<T>> for Ratio<T>

source§

#### fn mul_assign(&mut self, other: &Ratio<T>)

Performs the `*=` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> MulAssign<&'a T> for Ratio<T>

source§

#### fn mul_assign(&mut self, other: &T)

Performs the `*=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> MulAssign<T> for Ratio<T>

source§

#### fn mul_assign(&mut self, other: T)

Performs the `*=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> MulAssign for Ratio<T>

source§

#### fn mul_assign(&mut self, other: Ratio<T>)

Performs the `*=` operation. Read more
source§

### 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.
source§

#### fn neg(self) -> Ratio<T>

Performs the unary `-` operation. Read more
source§

### impl<T> Neg for Ratio<T>where T: Clone + Integer + Neg<Output = T>,

§

#### type Output = Ratio<T>

The resulting type after applying the `-` operator.
source§

#### fn neg(self) -> Ratio<T>

Performs the unary `-` operation. Read more
source§

### impl<T: Clone + Integer> Num for Ratio<T>

source§

#### fn from_str_radix(s: &str, radix: u32) -> Result<Ratio<T>, ParseRatioError>

Parses `numer/denom` where the numbers are in base `radix`.

§

source§

### impl<T: Octal + Clone + Integer> Octal for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

### impl<T: Clone + Integer> One for Ratio<T>

source§

#### fn one() -> Ratio<T>

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

#### fn is_one(&self) -> bool

Returns `true` if `self` is equal to the multiplicative identity. Read more
source§

#### fn set_one(&mut self)

Sets `self` to the multiplicative identity element of `Self`, `1`.
source§

### impl<T: Clone + Integer> Ord for Ratio<T>

source§

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

This method returns an `Ordering` between `self` and `other`. Read more
1.21.0 · source§

#### fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

#### fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

#### fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

### impl<T: Clone + Integer> PartialEq for Ratio<T>

source§

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

This method tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0 · source§

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

This method tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

### impl<T: Clone + Integer> PartialOrd for Ratio<T>

source§

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

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

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

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

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

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

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

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

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

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

### impl<'a, 'b, T: Clone + Integer> Pow<&'b BigInt> for &'a Ratio<T>where &'a T: Pow<&'b BigUint, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b BigInt) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<&'b BigUint, Output = T>> Pow<&'b BigInt> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b BigInt) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b BigUint> for &'a Ratio<T>where &'a T: Pow<&'b BigUint, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b BigUint) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<&'b BigUint, Output = T>> Pow<&'b BigUint> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b BigUint) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b i128> for &'a Ratio<T>where &'a T: Pow<u128, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u128, Output = T>> Pow<&'b i128> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b i16> for &'a Ratio<T>where &'a T: Pow<u16, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'b i16> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b i32> for &'a Ratio<T>where &'a T: Pow<u32, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'b i32> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b i64> for &'a Ratio<T>where &'a T: Pow<u64, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'b i64> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b i8> for &'a Ratio<T>where &'a T: Pow<u8, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'b i8> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b i8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b isize> for &'a Ratio<T>where &'a T: Pow<usize, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b isize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'b isize> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b isize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b u128> for &'a Ratio<T>where &'a T: Pow<u128, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u128, Output = T>> Pow<&'b u128> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b u16> for &'a Ratio<T>where &'a T: Pow<u16, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u16, Output = T>> Pow<&'b u16> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b u32> for &'a Ratio<T>where &'a T: Pow<u32, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u32, Output = T>> Pow<&'b u32> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b u64> for &'a Ratio<T>where &'a T: Pow<u64, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u64, Output = T>> Pow<&'b u64> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b u8> for &'a Ratio<T>where &'a T: Pow<u8, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<u8, Output = T>> Pow<&'b u8> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b u8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Pow<&'b usize> for &'a Ratio<T>where &'a T: Pow<usize, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b usize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'b, T: Clone + Integer + Pow<usize, Output = T>> Pow<&'b usize> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: &'b usize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<BigInt> for &'a Ratio<T>where &'a T: for<'b> Pow<&'b BigUint, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: BigInt) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + for<'b> Pow<&'b BigUint, Output = T>> Pow<BigInt> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: BigInt) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<BigUint> for &'a Ratio<T>where &'a T: for<'b> Pow<&'b BigUint, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: BigUint) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + for<'b> Pow<&'b BigUint, Output = T>> Pow<BigUint> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: BigUint) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<i128> for &'a Ratio<T>where &'a T: Pow<u128, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u128, Output = T>> Pow<i128> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<i16> for &'a Ratio<T>where &'a T: Pow<u16, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u16, Output = T>> Pow<i16> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<i32> for &'a Ratio<T>where &'a T: Pow<u32, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u32, Output = T>> Pow<i32> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<i64> for &'a Ratio<T>where &'a T: Pow<u64, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u64, Output = T>> Pow<i64> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<i8> for &'a Ratio<T>where &'a T: Pow<u8, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u8, Output = T>> Pow<i8> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: i8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<isize> for &'a Ratio<T>where &'a T: Pow<usize, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: isize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<usize, Output = T>> Pow<isize> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: isize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<u128> for &'a Ratio<T>where &'a T: Pow<u128, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u128, Output = T>> Pow<u128> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u128) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<u16> for &'a Ratio<T>where &'a T: Pow<u16, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u16, Output = T>> Pow<u16> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u16) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<u32> for &'a Ratio<T>where &'a T: Pow<u32, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u32, Output = T>> Pow<u32> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u32) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<u64> for &'a Ratio<T>where &'a T: Pow<u64, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u64, Output = T>> Pow<u64> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u64) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<u8> for &'a Ratio<T>where &'a T: Pow<u8, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<u8, Output = T>> Pow<u8> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: u8) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Clone + Integer> Pow<usize> for &'a Ratio<T>where &'a T: Pow<usize, Output = T>,

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: usize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<T: Clone + Integer + Pow<usize, Output = T>> Pow<usize> for Ratio<T>

§

#### type Output = Ratio<T>

The result after applying the operator.
source§

#### fn pow(self, expon: usize) -> Ratio<T>

Returns `self` to the power `rhs`. Read more
source§

### impl<'a, T: Integer + Clone> Product<&'a Ratio<T>> for Ratio<T>

source§

#### fn product<I>(iter: I) -> Selfwhere I: Iterator<Item = &'a Ratio<T>>,

Method which takes an iterator and generates `Self` from the elements by multiplying the items.
source§

### impl<T: Integer + Clone> Product for Ratio<T>

source§

#### fn product<I>(iter: I) -> Selfwhere I: Iterator<Item = Ratio<T>>,

Method which takes an iterator and generates `Self` from the elements by multiplying the items.
source§

### 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.
source§

#### fn rem(self, other: &'b Ratio<T>) -> Ratio<T>

Performs the `%` operation. Read more
source§

### 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.
source§

#### fn rem(self, other: &Ratio<T>) -> Ratio<T>

Performs the `%` operation. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Rem<&'b T> for &'a Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `%` operator.
source§

#### fn rem(self, other: &'b T) -> Ratio<T>

Performs the `%` operation. Read more
source§

### impl<'a, T> Rem<&'a T> for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `%` operator.
source§

#### fn rem(self, other: &T) -> Ratio<T>

Performs the `%` operation. Read more
source§

### 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.
source§

#### fn rem(self, other: Ratio<T>) -> Ratio<T>

Performs the `%` operation. Read more
source§

### impl<'a, T> Rem<T> for &'a Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `%` operator.
source§

#### fn rem(self, other: T) -> Ratio<T>

Performs the `%` operation. Read more
source§

### impl<T: Clone + Integer> Rem<T> for Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `%` operator.
source§

#### fn rem(self, rhs: T) -> Ratio<T>

Performs the `%` operation. Read more
source§

### impl<T: Clone + Integer> Rem for Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `%` operator.
source§

#### fn rem(self, rhs: Ratio<T>) -> Ratio<T>

Performs the `%` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> RemAssign<&'a Ratio<T>> for Ratio<T>

source§

#### fn rem_assign(&mut self, other: &Ratio<T>)

Performs the `%=` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> RemAssign<&'a T> for Ratio<T>

source§

#### fn rem_assign(&mut self, other: &T)

Performs the `%=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> RemAssign<T> for Ratio<T>

source§

#### fn rem_assign(&mut self, other: T)

Performs the `%=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> RemAssign for Ratio<T>

source§

#### fn rem_assign(&mut self, other: Ratio<T>)

Performs the `%=` operation. Read more
source§

### impl<T: Clone + Integer + Signed> Signed for Ratio<T>

source§

#### fn abs(&self) -> Ratio<T>

Computes the absolute value. Read more
source§

#### fn abs_sub(&self, other: &Ratio<T>) -> Ratio<T>

The positive difference of two numbers. Read more
source§

#### fn signum(&self) -> Ratio<T>

Returns the sign of the number. Read more
source§

#### fn is_positive(&self) -> bool

Returns true if the number is positive and false if the number is zero or negative.
source§

#### fn is_negative(&self) -> bool

Returns true if the number is negative and false if the number is zero or positive.
source§

### 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.
source§

#### fn sub(self, other: &'b Ratio<T>) -> Ratio<T>

Performs the `-` operation. Read more
source§

### 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.
source§

#### fn sub(self, other: &Ratio<T>) -> Ratio<T>

Performs the `-` operation. Read more
source§

### impl<'a, 'b, T: Clone + Integer> Sub<&'b T> for &'a Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `-` operator.
source§

#### fn sub(self, other: &'b T) -> Ratio<T>

Performs the `-` operation. Read more
source§

### impl<'a, T> Sub<&'a T> for Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `-` operator.
source§

#### fn sub(self, other: &T) -> Ratio<T>

Performs the `-` operation. Read more
source§

### 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.
source§

#### fn sub(self, other: Ratio<T>) -> Ratio<T>

Performs the `-` operation. Read more
source§

### impl<'a, T> Sub<T> for &'a Ratio<T>where T: Clone + Integer,

§

#### type Output = Ratio<T>

The resulting type after applying the `-` operator.
source§

#### fn sub(self, other: T) -> Ratio<T>

Performs the `-` operation. Read more
source§

### impl<T: Clone + Integer> Sub<T> for Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `-` operator.
source§

#### fn sub(self, rhs: T) -> Ratio<T>

Performs the `-` operation. Read more
source§

### impl<T: Clone + Integer> Sub for Ratio<T>

§

#### type Output = Ratio<T>

The resulting type after applying the `-` operator.
source§

#### fn sub(self, rhs: Ratio<T>) -> Ratio<T>

Performs the `-` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> SubAssign<&'a Ratio<T>> for Ratio<T>

source§

#### fn sub_assign(&mut self, other: &Ratio<T>)

Performs the `-=` operation. Read more
source§

### impl<'a, T: Clone + Integer + NumAssign> SubAssign<&'a T> for Ratio<T>

source§

#### fn sub_assign(&mut self, other: &T)

Performs the `-=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> SubAssign<T> for Ratio<T>

source§

#### fn sub_assign(&mut self, other: T)

Performs the `-=` operation. Read more
source§

### impl<T: Clone + Integer + NumAssign> SubAssign for Ratio<T>

source§

#### fn sub_assign(&mut self, other: Ratio<T>)

Performs the `-=` operation. Read more
source§

### impl<'a, T: Integer + Clone> Sum<&'a Ratio<T>> for Ratio<T>

source§

#### fn sum<I>(iter: I) -> Selfwhere I: Iterator<Item = &'a Ratio<T>>,

Method which takes an iterator and generates `Self` from the elements by “summing up” the items.
source§

### impl<T: Integer + Clone> Sum for Ratio<T>

source§

#### fn sum<I>(iter: I) -> Selfwhere I: Iterator<Item = Ratio<T>>,

Method which takes an iterator and generates `Self` from the elements by “summing up” the items.
source§

### impl<T: Clone + Integer + ToPrimitive + ToBigInt> ToPrimitive for Ratio<T>

source§

#### fn to_i64(&self) -> Option<i64>

Converts the value of `self` to an `i64`. If the value cannot be represented by an `i64`, then `None` is returned.
source§

#### fn to_i128(&self) -> Option<i128>

Converts the value of `self` to an `i128`. If the value cannot be represented by an `i128` (`i64` under the default implementation), then `None` is returned. Read more
source§

#### fn to_u64(&self) -> Option<u64>

Converts the value of `self` to a `u64`. If the value cannot be represented by a `u64`, then `None` is returned.
source§

#### fn to_u128(&self) -> Option<u128>

Converts the value of `self` to a `u128`. If the value cannot be represented by a `u128` (`u64` under the default implementation), then `None` is returned. Read more
source§

#### fn to_f64(&self) -> Option<f64>

Converts the value of `self` to an `f64`. Overflows may map to positive or negative inifinity, otherwise `None` is returned if the value cannot be represented by an `f64`. Read more
source§

#### fn to_isize(&self) -> Option<isize>

Converts the value of `self` to an `isize`. If the value cannot be represented by an `isize`, then `None` is returned.
source§

#### fn to_i8(&self) -> Option<i8>

Converts the value of `self` to an `i8`. If the value cannot be represented by an `i8`, then `None` is returned.
source§

#### fn to_i16(&self) -> Option<i16>

Converts the value of `self` to an `i16`. If the value cannot be represented by an `i16`, then `None` is returned.
source§

#### fn to_i32(&self) -> Option<i32>

Converts the value of `self` to an `i32`. If the value cannot be represented by an `i32`, then `None` is returned.
source§

#### fn to_usize(&self) -> Option<usize>

Converts the value of `self` to a `usize`. If the value cannot be represented by a `usize`, then `None` is returned.
source§

#### fn to_u8(&self) -> Option<u8>

Converts the value of `self` to a `u8`. If the value cannot be represented by a `u8`, then `None` is returned.
source§

#### fn to_u16(&self) -> Option<u16>

Converts the value of `self` to a `u16`. If the value cannot be represented by a `u16`, then `None` is returned.
source§

#### fn to_u32(&self) -> Option<u32>

Converts the value of `self` to a `u32`. If the value cannot be represented by a `u32`, then `None` is returned.
source§

#### fn to_f32(&self) -> Option<f32>

Converts the value of `self` to an `f32`. Overflows may map to positive or negative inifinity, otherwise `None` is returned if the value cannot be represented by an `f32`.
source§

### impl<T: UpperExp + Clone + Integer> UpperExp for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

### impl<T: UpperHex + Clone + Integer> UpperHex for Ratio<T>

source§

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

### impl<T: Clone + Integer> Zero for Ratio<T>

source§

#### fn zero() -> Ratio<T>

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

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

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

#### fn set_zero(&mut self)

Sets `self` to the additive identity element of `Self`, `0`.
source§

source§

§

§

§

§

§

§

## Blanket Implementations§

source§

### impl<T> Any for Twhere T: 'static + ?Sized,

source§

#### fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more
source§

### impl<T> Borrow<T> for Twhere T: ?Sized,

source§

#### fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

### impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

#### fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

### impl<T> From<T> for T

source§

#### fn from(t: T) -> T

Returns the argument unchanged.

source§

### impl<T, U> Into<U> for Twhere U: From<T>,

source§

#### fn into(self) -> U

Calls `U::from(self)`.

That is, this conversion is whatever the implementation of `From<T> for U` chooses to do.

source§

### impl<T> ToOwned for Twhere T: Clone,

§

#### type Owned = T

The resulting type after obtaining ownership.
source§

#### fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

#### fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

### impl<T> ToString for Twhere T: Display + ?Sized,

source§

#### default fn to_string(&self) -> String

Converts the given value to a `String`. Read more
source§

### impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

#### type Error = Infallible

The type returned in the event of a conversion error.
source§

#### fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

### impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

#### fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

source§

source§

source§

source§

source§