Struct clef::math::Fraction[][src]

pub struct Fraction { /* fields omitted */ }

Implementations

impl Fraction[src]

pub const ZERO: Fraction[src]

pub const ONE: Fraction[src]

pub const HALF: Fraction[src]

impl Fraction[src]

pub fn new(numerator: i32, denominator: i32) -> Fraction[src]

Contracts

Pre-condition: denominator must not be zero

  • denominator != 0

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.

impl Add<i32> for Fraction[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Fraction> for Fraction[src]

impl AddAssign<i32> for Fraction[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.

impl Div<i32> for Fraction[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<Fraction> for Fraction[src]

impl DivAssign<i32> for Fraction[src]

impl Eq for Fraction[src]

impl Mul<Fraction> for Fraction[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<i32> for Fraction[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Fraction> for Fraction[src]

impl MulAssign<i32> for Fraction[src]

impl Neg for Fraction[src]

type Output = Self

The resulting type after applying the - operator.

impl Ord for Fraction[src]

impl PartialEq<Fraction> for Fraction[src]

impl PartialOrd<Fraction> for Fraction[src]

impl StructuralEq for Fraction[src]

impl Sub<Fraction> for Fraction[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<i32> for Fraction[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Fraction> for Fraction[src]

impl SubAssign<i32> for Fraction[src]

impl TryFrom<Fraction> for Duration[src]

type Error = &'static str

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.