Struct rational::Rational [−][src]
pub struct Rational { /* fields omitted */ }
Expand description
A rational number (a fraction of two integers).
Implementations
Construct a new Rational, returning None
if the denominator is 0.
Set the numerator of this Rational
.
Get the denominator in this Rational
.
Set the denominator of this Rational
.
Returns the inverse of this Rational
, or None
if the denominator of the inverse is 0.
Returns the decimal value of this Rational
.
Equivalent to f64::from(self)
.
Trait Implementations
Performs the +=
operation. Read more
Performs the /=
operation. Read more
Performs the *=
operation. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Performs the -=
operation. Read more
Auto Trait Implementations
impl RefUnwindSafe for Rational
impl UnwindSafe for Rational
Blanket Implementations
Mutably borrows from an owned value. Read more