Struct embedded_time::fraction::Fraction [−][src]
pub struct Fraction(_);
Expand description
Implementations
Construct a new Fraction
.
A reduction is not performed. Also there is no check for a denominator of 0
. If these
features are needed, use Fraction::new_reduce()
Return the denominator of the fraction
Construct a new Fraction
.
A reduction and denominator == 0
check are performed.
Errors
ConversionError::DivByZero
: A 0
denominator was detected
Returns the value truncated to an integer
Constructs a Fraction
from an integer.
Equivalent to Fraction::new(value,1)
.
Trait Implementations
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