[−][src]Struct num::rational::Ratio
Represents the ratio between two numbers.
Implementations
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> Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
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: for<'a> Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
[src]
&'a T: for<'a> Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
Raises the Ratio
to the power of an exponent.
impl Ratio<BigInt>
[src]
pub fn from_float<T>(f: T) -> Option<Ratio<BigInt>> where
T: FloatCore,
[src]
T: FloatCore,
Converts a float into a rational number.
impl<T> Ratio<T> where
T: Clone + Integer + Bounded + NumCast + Signed,
[src]
T: Clone + Integer + Bounded + NumCast + Signed,
Trait Implementations
impl<'a, T> Add<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, other: &Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Add<&'a T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, other: &T) -> Ratio<T>
[src]
impl<'a, 'b, T> Add<&'b Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, other: &'b Ratio<T>) -> Ratio<T>
[src]
impl<'a, 'b, T> Add<&'b T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, other: &'b T) -> Ratio<T>
[src]
impl<'a, T> Add<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, other: Ratio<T>) -> Ratio<T>
[src]
impl<T> Add<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, rhs: Ratio<T>) -> Ratio<T>
[src]
impl<T> Add<T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, rhs: T) -> Ratio<T>
[src]
impl<'a, T> Add<T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the +
operator.
pub fn add(self, other: T) -> Ratio<T>
[src]
impl<'a, T> AddAssign<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn add_assign(&mut self, other: &Ratio<T>)
[src]
impl<'a, T> AddAssign<&'a T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn add_assign(&mut self, other: &T)
[src]
impl<T> AddAssign<Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn add_assign(&mut self, other: Ratio<T>)
[src]
impl<T> AddAssign<T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn add_assign(&mut self, other: T)
[src]
impl<T> Binary for Ratio<T> where
T: Clone + Binary + Integer,
[src]
T: Clone + Binary + Integer,
impl<T> CheckedAdd for Ratio<T> where
T: Clone + Integer + CheckedAdd + CheckedMul,
[src]
T: Clone + Integer + CheckedAdd + CheckedMul,
pub fn checked_add(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
impl<T> CheckedDiv for Ratio<T> where
T: Clone + Integer + CheckedMul,
[src]
T: Clone + Integer + CheckedMul,
pub fn checked_div(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
impl<T> CheckedMul for Ratio<T> where
T: Clone + Integer + CheckedMul,
[src]
T: Clone + Integer + CheckedMul,
pub fn checked_mul(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
impl<T> CheckedSub for Ratio<T> where
T: Clone + Integer + CheckedSub + CheckedMul,
[src]
T: Clone + Integer + CheckedSub + CheckedMul,
pub fn checked_sub(&self, rhs: &Ratio<T>) -> Option<Ratio<T>>
[src]
impl<T> Clone for Ratio<T> where
T: Clone,
[src]
T: Clone,
impl<T> Copy for Ratio<T> where
T: Copy,
[src]
T: Copy,
impl<T> Debug for Ratio<T> where
T: Debug,
[src]
T: Debug,
impl<'de, T> Deserialize<'de> for Ratio<T> where
T: Deserialize<'de> + Clone + Integer + PartialOrd<T>,
[src]
T: Deserialize<'de> + Clone + Integer + PartialOrd<T>,
pub fn deserialize<D>(
deserializer: D
) -> Result<Ratio<T>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<Ratio<T>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl<T> Display for Ratio<T> where
T: Clone + Display + Integer,
[src]
T: Clone + Display + Integer,
impl<'a, T> Div<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, other: &Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Div<&'a T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, other: &T) -> Ratio<T>
[src]
impl<'a, 'b, T> Div<&'b Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, other: &'b Ratio<T>) -> Ratio<T>
[src]
impl<'a, 'b, T> Div<&'b T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, other: &'b T) -> Ratio<T>
[src]
impl<'a, T> Div<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, other: Ratio<T>) -> Ratio<T>
[src]
impl<T> Div<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, rhs: Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Div<T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, other: T) -> Ratio<T>
[src]
impl<T> Div<T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the /
operator.
pub fn div(self, rhs: T) -> Ratio<T>
[src]
impl<'a, T> DivAssign<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn div_assign(&mut self, other: &Ratio<T>)
[src]
impl<'a, T> DivAssign<&'a T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn div_assign(&mut self, other: &T)
[src]
impl<T> DivAssign<Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn div_assign(&mut self, other: Ratio<T>)
[src]
impl<T> DivAssign<T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn div_assign(&mut self, other: T)
[src]
impl<T> Eq for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> From<(T, T)> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> From<T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl FromPrimitive for Ratio<u32>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<u32>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<u32>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<u32>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<u32>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<u32>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<u32>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u16>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<u16>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<u16>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<u16>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<u16>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<u16>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<u16>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i16>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<i16>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<i16>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<i16>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<i16>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<i16>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<i16>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<BigInt>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<BigInt>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<BigInt>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<BigInt>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<BigInt>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<BigInt>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<BigInt>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u128>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<u128>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<u128>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<u128>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<u128>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<u128>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<u128>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i128>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<i128>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<i128>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<i128>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<i128>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<i128>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<i128>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i64>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<i64>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<i64>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<i64>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<i64>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<i64>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<i64>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i8>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<i8>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<i8>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<i8>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<i8>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<i8>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<i8>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u64>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<u64>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<u64>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<u64>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<u64>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<u64>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<u64>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<i32>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<i32>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<i32>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<i32>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<i32>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<i32>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<i32>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<u8>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<u8>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<u8>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<u8>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<u8>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<u8>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<u8>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<isize>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<isize>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<isize>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<isize>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<isize>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<isize>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<isize>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl FromPrimitive for Ratio<usize>
[src]
pub fn from_i64(n: i64) -> Option<Ratio<usize>>
[src]
pub fn from_i128(n: i128) -> Option<Ratio<usize>>
[src]
pub fn from_u64(n: u64) -> Option<Ratio<usize>>
[src]
pub fn from_u128(n: u128) -> Option<Ratio<usize>>
[src]
pub fn from_f32(n: f32) -> Option<Ratio<usize>>
[src]
pub fn from_f64(n: f64) -> Option<Ratio<usize>>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
impl<T> FromStr for Ratio<T> where
T: Clone + FromStr + Integer,
[src]
T: Clone + FromStr + Integer,
type Err = ParseRatioError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Ratio<T>, ParseRatioError>
[src]
Parses numer/denom
or just numer
.
impl<T> Hash for Ratio<T> where
T: Clone + Hash + Integer,
[src]
T: Clone + Hash + Integer,
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> Into<(T, T)> for Ratio<T>
[src]
impl<'a, T> Inv for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> Inv for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> LowerExp for Ratio<T> where
T: Clone + LowerExp + Integer,
[src]
T: Clone + LowerExp + Integer,
impl<T> LowerHex for Ratio<T> where
T: Clone + LowerHex + Integer,
[src]
T: Clone + LowerHex + Integer,
impl<'a, T> Mul<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: &Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Mul<&'a T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: &T) -> Ratio<T>
[src]
impl<'a, 'b, T> Mul<&'b Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: &'b Ratio<T>) -> Ratio<T>
[src]
impl<'a, 'b, T> Mul<&'b T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: &'b T) -> Ratio<T>
[src]
impl<'a, T> Mul<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: Ratio<T>) -> Ratio<T>
[src]
impl<T> Mul<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: Ratio<T>) -> Ratio<T>
[src]
impl<T> Mul<T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, rhs: T) -> Ratio<T>
[src]
impl<'a, T> Mul<T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the *
operator.
pub fn mul(self, other: T) -> Ratio<T>
[src]
impl<'a, T> MulAssign<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn mul_assign(&mut self, other: &Ratio<T>)
[src]
impl<'a, T> MulAssign<&'a T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn mul_assign(&mut self, other: &T)
[src]
impl<T> MulAssign<Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn mul_assign(&mut self, other: Ratio<T>)
[src]
impl<T> MulAssign<T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn mul_assign(&mut self, other: T)
[src]
impl<T> Neg for Ratio<T> where
T: Clone + Integer + Neg<Output = T>,
[src]
T: Clone + Integer + Neg<Output = T>,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn neg(self) -> Ratio<T>
[src]
impl<'a, T> Neg for &'a Ratio<T> where
T: Clone + Integer + Neg<Output = T>,
[src]
T: Clone + Integer + Neg<Output = T>,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn neg(self) -> Ratio<T>
[src]
impl<T> Num for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type FromStrRadixErr = ParseRatioError
pub fn from_str_radix(s: &str, radix: u32) -> Result<Ratio<T>, ParseRatioError>
[src]
Parses numer/denom
where the numbers are in base radix
.
impl<T> Octal for Ratio<T> where
T: Clone + Octal + Integer,
[src]
T: Clone + Octal + Integer,
impl<T> One for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> Ord for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
pub fn cmp(&self, other: &Ratio<T>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T> PartialEq<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
pub fn eq(&self, other: &Ratio<T>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T> PartialOrd<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
pub fn partial_cmp(&self, other: &Ratio<T>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'b, T> Pow<&'b BigInt> for Ratio<T> where
T: Clone + Integer + Pow<&'b BigUint, Output = T>,
[src]
T: Clone + Integer + Pow<&'b BigUint, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b BigInt) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b BigInt> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b BigInt) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b BigUint> for Ratio<T> where
T: Clone + Integer + Pow<&'b BigUint, Output = T>,
[src]
T: Clone + Integer + Pow<&'b BigUint, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b BigUint) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b BigUint> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b BigUint) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b i128> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i128) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b i128> for Ratio<T> where
T: Clone + Integer + Pow<u128, Output = T>,
[src]
T: Clone + Integer + Pow<u128, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i128) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b i16> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i16) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b i16> for Ratio<T> where
T: Clone + Integer + Pow<u16, Output = T>,
[src]
T: Clone + Integer + Pow<u16, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i16) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b i32> for Ratio<T> where
T: Clone + Integer + Pow<u32, Output = T>,
[src]
T: Clone + Integer + Pow<u32, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i32) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b i32> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i32) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b i64> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i64) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b i64> for Ratio<T> where
T: Clone + Integer + Pow<u64, Output = T>,
[src]
T: Clone + Integer + Pow<u64, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i64) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b i8> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i8) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b i8> for Ratio<T> where
T: Clone + Integer + Pow<u8, Output = T>,
[src]
T: Clone + Integer + Pow<u8, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b i8) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b isize> for Ratio<T> where
T: Clone + Integer + Pow<usize, Output = T>,
[src]
T: Clone + Integer + Pow<usize, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b isize) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b isize> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b isize) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b u128> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u128) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b u128> for Ratio<T> where
T: Clone + Integer + Pow<u128, Output = T>,
[src]
T: Clone + Integer + Pow<u128, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u128) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b u16> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u16) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b u16> for Ratio<T> where
T: Clone + Integer + Pow<u16, Output = T>,
[src]
T: Clone + Integer + Pow<u16, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u16) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b u32> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u32) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b u32> for Ratio<T> where
T: Clone + Integer + Pow<u32, Output = T>,
[src]
T: Clone + Integer + Pow<u32, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u32) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b u64> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u64) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b u64> for Ratio<T> where
T: Clone + Integer + Pow<u64, Output = T>,
[src]
T: Clone + Integer + Pow<u64, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u64) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b u8> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u8) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b u8> for Ratio<T> where
T: Clone + Integer + Pow<u8, Output = T>,
[src]
T: Clone + Integer + Pow<u8, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b u8) -> Ratio<T>
[src]
impl<'a, 'b, T> Pow<&'b usize> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b usize) -> Ratio<T>
[src]
impl<'b, T> Pow<&'b usize> for Ratio<T> where
T: Clone + Integer + Pow<usize, Output = T>,
[src]
T: Clone + Integer + Pow<usize, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: &'b usize) -> Ratio<T>
[src]
impl<T> Pow<BigInt> for Ratio<T> where
T: Clone + Integer + for<'b> Pow<&'b BigUint, Output = T>,
[src]
T: Clone + Integer + for<'b> Pow<&'b BigUint, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: BigInt) -> Ratio<T>
[src]
impl<'a, T> Pow<BigInt> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: for<'b> Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
[src]
T: Clone + Integer,
&'a T: for<'b> Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: BigInt) -> Ratio<T>
[src]
impl<T> Pow<BigUint> for Ratio<T> where
T: Clone + Integer + for<'b> Pow<&'b BigUint, Output = T>,
[src]
T: Clone + Integer + for<'b> Pow<&'b BigUint, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: BigUint) -> Ratio<T>
[src]
impl<'a, T> Pow<BigUint> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: for<'b> Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
[src]
T: Clone + Integer,
&'a T: for<'b> Pow<&'b BigUint>,
<&'a T as Pow<&'b BigUint>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: BigUint) -> Ratio<T>
[src]
impl<'a, T> Pow<i128> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i128) -> Ratio<T>
[src]
impl<T> Pow<i128> for Ratio<T> where
T: Clone + Integer + Pow<u128, Output = T>,
[src]
T: Clone + Integer + Pow<u128, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i128) -> Ratio<T>
[src]
impl<'a, T> Pow<i16> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i16) -> Ratio<T>
[src]
impl<T> Pow<i16> for Ratio<T> where
T: Clone + Integer + Pow<u16, Output = T>,
[src]
T: Clone + Integer + Pow<u16, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i16) -> Ratio<T>
[src]
impl<T> Pow<i32> for Ratio<T> where
T: Clone + Integer + Pow<u32, Output = T>,
[src]
T: Clone + Integer + Pow<u32, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i32) -> Ratio<T>
[src]
impl<'a, T> Pow<i32> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i32) -> Ratio<T>
[src]
impl<T> Pow<i64> for Ratio<T> where
T: Clone + Integer + Pow<u64, Output = T>,
[src]
T: Clone + Integer + Pow<u64, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i64) -> Ratio<T>
[src]
impl<'a, T> Pow<i64> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i64) -> Ratio<T>
[src]
impl<T> Pow<i8> for Ratio<T> where
T: Clone + Integer + Pow<u8, Output = T>,
[src]
T: Clone + Integer + Pow<u8, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i8) -> Ratio<T>
[src]
impl<'a, T> Pow<i8> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: i8) -> Ratio<T>
[src]
impl<T> Pow<isize> for Ratio<T> where
T: Clone + Integer + Pow<usize, Output = T>,
[src]
T: Clone + Integer + Pow<usize, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: isize) -> Ratio<T>
[src]
impl<'a, T> Pow<isize> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: isize) -> Ratio<T>
[src]
impl<'a, T> Pow<u128> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u128>,
<&'a T as Pow<u128>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u128) -> Ratio<T>
[src]
impl<T> Pow<u128> for Ratio<T> where
T: Clone + Integer + Pow<u128, Output = T>,
[src]
T: Clone + Integer + Pow<u128, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u128) -> Ratio<T>
[src]
impl<'a, T> Pow<u16> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u16>,
<&'a T as Pow<u16>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u16) -> Ratio<T>
[src]
impl<T> Pow<u16> for Ratio<T> where
T: Clone + Integer + Pow<u16, Output = T>,
[src]
T: Clone + Integer + Pow<u16, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u16) -> Ratio<T>
[src]
impl<T> Pow<u32> for Ratio<T> where
T: Clone + Integer + Pow<u32, Output = T>,
[src]
T: Clone + Integer + Pow<u32, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u32) -> Ratio<T>
[src]
impl<'a, T> Pow<u32> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u32>,
<&'a T as Pow<u32>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u32) -> Ratio<T>
[src]
impl<T> Pow<u64> for Ratio<T> where
T: Clone + Integer + Pow<u64, Output = T>,
[src]
T: Clone + Integer + Pow<u64, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u64) -> Ratio<T>
[src]
impl<'a, T> Pow<u64> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u64>,
<&'a T as Pow<u64>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u64) -> Ratio<T>
[src]
impl<T> Pow<u8> for Ratio<T> where
T: Clone + Integer + Pow<u8, Output = T>,
[src]
T: Clone + Integer + Pow<u8, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u8) -> Ratio<T>
[src]
impl<'a, T> Pow<u8> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<u8>,
<&'a T as Pow<u8>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: u8) -> Ratio<T>
[src]
impl<'a, T> Pow<usize> for &'a Ratio<T> where
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
[src]
T: Clone + Integer,
&'a T: Pow<usize>,
<&'a T as Pow<usize>>::Output == T,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: usize) -> Ratio<T>
[src]
impl<T> Pow<usize> for Ratio<T> where
T: Clone + Integer + Pow<usize, Output = T>,
[src]
T: Clone + Integer + Pow<usize, Output = T>,
type Output = Ratio<T>
The result after applying the operator.
pub fn pow(self, expon: usize) -> Ratio<T>
[src]
impl<'a, T> Product<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> Product<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<'a, T> Rem<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, other: &Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Rem<&'a T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, other: &T) -> Ratio<T>
[src]
impl<'a, 'b, T> Rem<&'b Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, other: &'b Ratio<T>) -> Ratio<T>
[src]
impl<'a, 'b, T> Rem<&'b T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, other: &'b T) -> Ratio<T>
[src]
impl<T> Rem<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, rhs: Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Rem<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, other: Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Rem<T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, other: T) -> Ratio<T>
[src]
impl<T> Rem<T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the %
operator.
pub fn rem(self, rhs: T) -> Ratio<T>
[src]
impl<'a, T> RemAssign<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn rem_assign(&mut self, other: &Ratio<T>)
[src]
impl<'a, T> RemAssign<&'a T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn rem_assign(&mut self, other: &T)
[src]
impl<T> RemAssign<Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn rem_assign(&mut self, other: Ratio<T>)
[src]
impl<T> RemAssign<T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn rem_assign(&mut self, other: T)
[src]
impl<T> Serialize for Ratio<T> where
T: Serialize + Clone + Integer + PartialOrd<T>,
[src]
T: Serialize + Clone + Integer + PartialOrd<T>,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl<T> Signed for Ratio<T> where
T: Clone + Integer + Signed,
[src]
T: Clone + Integer + Signed,
pub fn abs(&self) -> Ratio<T>
[src]
pub fn abs_sub(&self, other: &Ratio<T>) -> Ratio<T>
[src]
pub fn signum(&self) -> Ratio<T>
[src]
pub fn is_positive(&self) -> bool
[src]
pub fn is_negative(&self) -> bool
[src]
impl<'a, T> Sub<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: &Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Sub<&'a T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: &T) -> Ratio<T>
[src]
impl<'a, 'b, T> Sub<&'b Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: &'b Ratio<T>) -> Ratio<T>
[src]
impl<'a, 'b, T> Sub<&'b T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: &'b T) -> Ratio<T>
[src]
impl<T> Sub<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Sub<Ratio<T>> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: Ratio<T>) -> Ratio<T>
[src]
impl<'a, T> Sub<T> for &'a Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, other: T) -> Ratio<T>
[src]
impl<T> Sub<T> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
type Output = Ratio<T>
The resulting type after applying the -
operator.
pub fn sub(self, rhs: T) -> Ratio<T>
[src]
impl<'a, T> SubAssign<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn sub_assign(&mut self, other: &Ratio<T>)
[src]
impl<'a, T> SubAssign<&'a T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn sub_assign(&mut self, other: &T)
[src]
impl<T> SubAssign<Ratio<T>> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn sub_assign(&mut self, other: Ratio<T>)
[src]
impl<T> SubAssign<T> for Ratio<T> where
T: Clone + Integer + NumAssign,
[src]
T: Clone + Integer + NumAssign,
pub fn sub_assign(&mut self, other: T)
[src]
impl<'a, T> Sum<&'a Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> Sum<Ratio<T>> for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
impl<T> ToPrimitive for Ratio<T> where
T: Clone + ToBigInt + Integer + ToPrimitive,
[src]
T: Clone + ToBigInt + Integer + ToPrimitive,
pub fn to_i64(&self) -> Option<i64>
[src]
pub fn to_i128(&self) -> Option<i128>
[src]
pub fn to_u64(&self) -> Option<u64>
[src]
pub fn to_u128(&self) -> Option<u128>
[src]
pub fn to_f64(&self) -> Option<f64>
[src]
fn to_isize(&self) -> Option<isize>
[src]
fn to_i8(&self) -> Option<i8>
[src]
fn to_i16(&self) -> Option<i16>
[src]
fn to_i32(&self) -> Option<i32>
[src]
fn to_usize(&self) -> Option<usize>
[src]
fn to_u8(&self) -> Option<u8>
[src]
fn to_u16(&self) -> Option<u16>
[src]
fn to_u32(&self) -> Option<u32>
[src]
fn to_f32(&self) -> Option<f32>
[src]
impl<T> UpperExp for Ratio<T> where
T: Clone + UpperExp + Integer,
[src]
T: Clone + UpperExp + Integer,
impl<T> UpperHex for Ratio<T> where
T: Clone + UpperHex + Integer,
[src]
T: Clone + UpperHex + Integer,
impl<T> Zero for Ratio<T> where
T: Clone + Integer,
[src]
T: Clone + Integer,
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,