Struct num_rational::Ratio [−][src]
pub struct Ratio<T> { /* fields omitted */ }
Represents the ratio between two numbers.
Implementations
impl<T> Ratio<T>
[src]
impl<T> Ratio<T>
[src]These method are const
for Rust 1.31 and later.
pub const fn new_raw(numer: T, denom: T) -> Ratio<T>
[src]
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
.
pub const fn numer(&self) -> &T
[src]
Gets an immutable reference to the numerator.
pub const fn denom(&self) -> &T
[src]
Gets an immutable reference to the denominator.
impl<T: Clone + Integer> Ratio<T>
[src]
impl<T: Clone + Integer> Ratio<T>
[src]pub fn new(numer: T, denom: T) -> Ratio<T>
[src]
Creates a new Ratio
.
Panics if denom
is zero.
pub fn from_integer(t: T) -> Ratio<T>
[src]
Creates a Ratio
representing the integer t
.
pub fn to_integer(&self) -> T
[src]
Converts to an integer, rounding towards zero.
pub fn is_integer(&self) -> bool
[src]
Returns true if the rational number is an integer (denominator is 1).
pub fn reduced(&self) -> Ratio<T>
[src]
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.
pub fn recip(&self) -> Ratio<T>
[src]
Returns the reciprocal.
Panics if the Ratio
is zero.
pub fn floor(&self) -> Ratio<T>
[src]
Rounds towards minus infinity.
pub fn ceil(&self) -> Ratio<T>
[src]
Rounds towards plus infinity.
pub fn round(&self) -> Ratio<T>
[src]
Rounds to the nearest integer. Rounds half-way cases away from zero.
pub fn trunc(&self) -> Ratio<T>
[src]
Rounds towards zero.
pub fn fract(&self) -> Ratio<T>
[src]
Returns the fractional part of a number, with division rounded towards zero.
Satisfies self == self.trunc() + self.fract()
.
pub fn pow(&self, expon: i32) -> Ratio<T> where
&'a T: Pow<u32, Output = T>,
[src]
&'a T: Pow<u32, Output = T>,
Raises the Ratio
to the power of an exponent.
impl<T: Integer + Signed + Bounded + NumCast + Clone> Ratio<T>
[src]
impl<T: Integer + Signed + Bounded + NumCast + Clone> Ratio<T>
[src]Trait Implementations
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>
[src]fn add_assign(&mut self, other: &Ratio<T>)
[src]
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>
[src]fn add_assign(&mut self, other: &T)
[src]
impl<T: Clone + Integer + NumAssign> AddAssign<Ratio<T>> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> AddAssign<Ratio<T>> for Ratio<T>
[src]fn add_assign(&mut self, other: Ratio<T>)
[src]
impl<T: Clone + Integer + NumAssign> AddAssign<T> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> AddAssign<T> for Ratio<T>
[src]fn add_assign(&mut self, other: T)
[src]
impl<T: Clone + Integer + CheckedMul + CheckedAdd> CheckedAdd for Ratio<T>
[src]
impl<T: Clone + Integer + CheckedMul + CheckedAdd> CheckedAdd for Ratio<T>
[src]fn checked_add(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
impl<T> CheckedDiv for Ratio<T> where
T: Clone + Integer + CheckedMul,
[src]
impl<T> CheckedDiv for Ratio<T> where
T: Clone + Integer + CheckedMul,
[src]fn checked_div(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
impl<T> CheckedMul for Ratio<T> where
T: Clone + Integer + CheckedMul,
[src]
impl<T> CheckedMul for Ratio<T> where
T: Clone + Integer + CheckedMul,
[src]fn checked_mul(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
impl<T: Clone + Integer + CheckedMul + CheckedSub> CheckedSub for Ratio<T>
[src]
impl<T: Clone + Integer + CheckedMul + CheckedSub> CheckedSub for Ratio<T>
[src]fn checked_sub(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
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>
[src]fn div_assign(&mut self, other: &Ratio<T>)
[src]
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>
[src]fn div_assign(&mut self, other: &T)
[src]
impl<T: Clone + Integer + NumAssign> DivAssign<Ratio<T>> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> DivAssign<Ratio<T>> for Ratio<T>
[src]fn div_assign(&mut self, other: Ratio<T>)
[src]
impl<T: Clone + Integer + NumAssign> DivAssign<T> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> DivAssign<T> for Ratio<T>
[src]fn div_assign(&mut self, other: T)
[src]
impl FromPrimitive for Ratio<i8>
[src]
impl FromPrimitive for Ratio<i8>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i16>
[src]
impl FromPrimitive for Ratio<i16>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u128>
[src]
impl FromPrimitive for Ratio<u128>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<usize>
[src]
impl FromPrimitive for Ratio<usize>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i32>
[src]
impl FromPrimitive for Ratio<i32>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i64>
[src]
impl FromPrimitive for Ratio<i64>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i128>
[src]
impl FromPrimitive for Ratio<i128>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<isize>
[src]
impl FromPrimitive for Ratio<isize>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u8>
[src]
impl FromPrimitive for Ratio<u8>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u16>
[src]
impl FromPrimitive for Ratio<u16>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u32>
[src]
impl FromPrimitive for Ratio<u32>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u64>
[src]
impl FromPrimitive for Ratio<u64>
[src]fn from_i64(n: i64) -> Option<Self>
[src]
fn from_i128(n: i128) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_u128(n: u128) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_isize(n: isize) -> Option<Self>
[src]
pub fn from_i8(n: i8) -> Option<Self>
[src]
pub fn from_i16(n: i16) -> Option<Self>
[src]
pub fn from_i32(n: i32) -> Option<Self>
[src]
pub fn from_usize(n: usize) -> Option<Self>
[src]
pub fn from_u8(n: u8) -> Option<Self>
[src]
pub fn from_u16(n: u16) -> Option<Self>
[src]
pub fn from_u32(n: u32) -> Option<Self>
[src]
impl<T: FromStr + Clone + Integer> FromStr for Ratio<T>
[src]
impl<T: FromStr + Clone + Integer> FromStr for Ratio<T>
[src]type Err = ParseRatioError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Ratio<T>, ParseRatioError>
[src]
Parses numer/denom
or just numer
.
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>
[src]fn mul_assign(&mut self, other: &Ratio<T>)
[src]
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>
[src]fn mul_assign(&mut self, other: &T)
[src]
impl<T: Clone + Integer + NumAssign> MulAssign<Ratio<T>> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> MulAssign<Ratio<T>> for Ratio<T>
[src]fn mul_assign(&mut self, other: Ratio<T>)
[src]
impl<T: Clone + Integer + NumAssign> MulAssign<T> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> MulAssign<T> for Ratio<T>
[src]fn mul_assign(&mut self, other: T)
[src]
impl<T: Clone + Integer> Num for Ratio<T>
[src]
impl<T: Clone + Integer> Num for Ratio<T>
[src]type FromStrRadixErr = ParseRatioError
fn from_str_radix(s: &str, radix: u32) -> Result<Ratio<T>, ParseRatioError>
[src]
Parses numer/denom
where the numbers are in base radix
.
impl<'a, 'b, T: Clone + Integer> Pow<&'b i128> for &'a Ratio<T> where
&'a T: Pow<u128, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b i128> for &'a Ratio<T> where
&'a T: Pow<u128, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b i16> for &'a Ratio<T> where
&'a T: Pow<u16, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b i16> for &'a Ratio<T> where
&'a T: Pow<u16, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b i32> for &'a Ratio<T> where
&'a T: Pow<u32, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b i32> for &'a Ratio<T> where
&'a T: Pow<u32, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b i64> for &'a Ratio<T> where
&'a T: Pow<u64, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b i64> for &'a Ratio<T> where
&'a T: Pow<u64, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b i8> for &'a Ratio<T> where
&'a T: Pow<u8, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b i8> for &'a Ratio<T> where
&'a T: Pow<u8, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b isize> for &'a Ratio<T> where
&'a T: Pow<usize, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b isize> for &'a Ratio<T> where
&'a T: Pow<usize, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b u128> for &'a Ratio<T> where
&'a T: Pow<u128, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b u128> for &'a Ratio<T> where
&'a T: Pow<u128, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b u16> for &'a Ratio<T> where
&'a T: Pow<u16, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b u16> for &'a Ratio<T> where
&'a T: Pow<u16, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b u32> for &'a Ratio<T> where
&'a T: Pow<u32, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b u32> for &'a Ratio<T> where
&'a T: Pow<u32, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b u64> for &'a Ratio<T> where
&'a T: Pow<u64, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b u64> for &'a Ratio<T> where
&'a T: Pow<u64, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b u8> for &'a Ratio<T> where
&'a T: Pow<u8, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b u8> for &'a Ratio<T> where
&'a T: Pow<u8, Output = T>,
[src]impl<'a, 'b, T: Clone + Integer> Pow<&'b usize> for &'a Ratio<T> where
&'a T: Pow<usize, Output = T>,
[src]
impl<'a, 'b, T: Clone + Integer> Pow<&'b usize> for &'a Ratio<T> where
&'a T: Pow<usize, Output = T>,
[src]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>
[src]fn rem_assign(&mut self, other: &Ratio<T>)
[src]
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>
[src]fn rem_assign(&mut self, other: &T)
[src]
impl<T: Clone + Integer + NumAssign> RemAssign<Ratio<T>> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> RemAssign<Ratio<T>> for Ratio<T>
[src]fn rem_assign(&mut self, other: Ratio<T>)
[src]
impl<T: Clone + Integer + NumAssign> RemAssign<T> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> RemAssign<T> for Ratio<T>
[src]fn rem_assign(&mut self, other: T)
[src]
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>
[src]fn sub_assign(&mut self, other: &Ratio<T>)
[src]
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>
[src]fn sub_assign(&mut self, other: &T)
[src]
impl<T: Clone + Integer + NumAssign> SubAssign<Ratio<T>> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> SubAssign<Ratio<T>> for Ratio<T>
[src]fn sub_assign(&mut self, other: Ratio<T>)
[src]
impl<T: Clone + Integer + NumAssign> SubAssign<T> for Ratio<T>
[src]
impl<T: Clone + Integer + NumAssign> SubAssign<T> for Ratio<T>
[src]fn sub_assign(&mut self, other: T)
[src]
impl ToPrimitive for Ratio<u8>
[src]
impl ToPrimitive for Ratio<u8>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<i8>
[src]
impl ToPrimitive for Ratio<i8>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<u16>
[src]
impl ToPrimitive for Ratio<u16>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<i16>
[src]
impl ToPrimitive for Ratio<i16>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<u32>
[src]
impl ToPrimitive for Ratio<u32>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<i32>
[src]
impl ToPrimitive for Ratio<i32>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<u64>
[src]
impl ToPrimitive for Ratio<u64>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<i64>
[src]
impl ToPrimitive for Ratio<i64>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<usize>
[src]
impl ToPrimitive for Ratio<usize>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl ToPrimitive for Ratio<isize>
[src]
impl ToPrimitive for Ratio<isize>
[src]fn to_i64(&self) -> Option<i64>
[src]
fn to_i128(&self) -> Option<i128>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_u128(&self) -> Option<u128>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_isize(&self) -> Option<isize>
[src]
pub fn to_i8(&self) -> Option<i8>
[src]
pub fn to_i16(&self) -> Option<i16>
[src]
pub fn to_i32(&self) -> Option<i32>
[src]
pub fn to_usize(&self) -> Option<usize>
[src]
pub fn to_u8(&self) -> Option<u8>
[src]
pub fn to_u16(&self) -> Option<u16>
[src]
pub fn to_u32(&self) -> Option<u32>
[src]
pub fn to_f32(&self) -> Option<f32>
[src]
impl<T: Copy> Copy for Ratio<T>
[src]
impl<T: Clone + Integer> Eq for Ratio<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Ratio<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Ratio<T> where
T: Send,
T: Send,
impl<T> Sync for Ratio<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Ratio<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Ratio<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> NumAssign for T where
T: Num + NumAssignOps<T>,
[src]
T: Num + NumAssignOps<T>,
impl<T, Rhs> NumAssignOps<Rhs> for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
impl<T> NumAssignRef for T where
T: NumAssign + for<'r> NumAssignOps<&'r T>,
[src]
T: NumAssign + for<'r> NumAssignOps<&'r T>,
impl<T, Rhs, Output> NumOps<Rhs, Output> 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]
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 + for<'r> NumOps<&'r T, T>,
[src]
T: Num + for<'r> NumOps<&'r T, T>,
impl<T, Base> RefNum<Base> for T where
T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,
[src]
T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,