Struct clef::math::Fraction [−][src]
Implementations
impl Fraction
[src]
impl Fraction
[src]
pub fn new(numerator: i32, denominator: i32) -> Fraction
[src]
pub fn numerator(&self) -> i32
[src]
pub fn denominator(&self) -> i32
[src]
pub fn signum(&self) -> i32
[src]
pub fn to_irreducible(&self) -> Self
[src]
pub fn to_float(&self) -> f32
[src]
Trait Implementations
impl Add<Fraction> for Fraction
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl Add<i32> for Fraction
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: i32) -> Self::Output
[src]
impl AddAssign<Fraction> for Fraction
[src]
fn add_assign(&mut self, other: Self)
[src]
impl AddAssign<i32> for Fraction
[src]
fn add_assign(&mut self, other: i32)
[src]
impl Clone for Fraction
[src]
impl Copy for Fraction
[src]
impl Debug for Fraction
[src]
impl Display for Fraction
[src]
impl Div<Fraction> for Fraction
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self::Output
[src]
impl Div<i32> for Fraction
[src]
type Output = Self
The resulting type after applying the /
operator.
fn div(self, other: i32) -> Self::Output
[src]
impl DivAssign<Fraction> for Fraction
[src]
fn div_assign(&mut self, other: Self)
[src]
impl DivAssign<i32> for Fraction
[src]
fn div_assign(&mut self, other: i32)
[src]
impl Eq for Fraction
[src]
impl Mul<Fraction> for Fraction
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
impl Mul<i32> for Fraction
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, other: i32) -> Self::Output
[src]
impl MulAssign<Fraction> for Fraction
[src]
fn mul_assign(&mut self, other: Self)
[src]
impl MulAssign<i32> for Fraction
[src]
fn mul_assign(&mut self, other: i32)
[src]
impl Neg for Fraction
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl Ord for Fraction
[src]
fn cmp(&self, other: &Fraction) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Fraction> for Fraction
[src]
impl PartialOrd<Fraction> for Fraction
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Fraction
[src]
impl Sub<Fraction> for Fraction
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl Sub<i32> for Fraction
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, other: i32) -> Self::Output
[src]
impl SubAssign<Fraction> for Fraction
[src]
fn sub_assign(&mut self, other: Self)
[src]
impl SubAssign<i32> for Fraction
[src]
fn sub_assign(&mut self, other: i32)
[src]
impl TryFrom<Fraction> for Duration
[src]
Auto Trait Implementations
impl RefUnwindSafe for Fraction
impl Send for Fraction
impl Sync for Fraction
impl Unpin for Fraction
impl UnwindSafe for Fraction
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,