Struct bullet::rational::Rational
[−]
[src]
pub struct Rational { /* fields omitted */ }
Methods
impl Rational
[src]
fn new(num: i64, denom: i64) -> Rational
[src]
fn frac(&self) -> (i64, i64)
[src]
fn as_int(&self) -> Option<i64>
[src]
fn is_zero(&self) -> bool
[src]
fn is_negative(&self) -> bool
[src]
fn pow(&self, i: i32) -> Rational
[src]
fn to_f64(&self) -> f64
[src]
Trait Implementations
impl Copy for Rational
[src]
impl Clone for Rational
[src]
fn clone(&self) -> Rational
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Rational
[src]
impl Hash for Rational
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for Rational
[src]
impl PartialEq for Rational
[src]
fn eq(&self, __arg_0: &Rational) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Rational) -> bool
[src]
This method tests for !=
.
impl AddAssign<i64> for Rational
[src]
fn add_assign(&mut self, i: i64)
[src]
Performs the +=
operation.
impl AddAssign for Rational
[src]
fn add_assign(&mut self, rhs: Rational)
[src]
Performs the +=
operation.
impl MulAssign<i64> for Rational
[src]
fn mul_assign(&mut self, n: i64)
[src]
Performs the *=
operation.
impl MulAssign for Rational
[src]
fn mul_assign(&mut self, rhs: Rational)
[src]
Performs the *=
operation.
impl Mul for Rational
[src]
type Output = Rational
The resulting type after applying the *
operator.
fn mul(self, rhs: Rational) -> Rational
[src]
Performs the *
operation.
impl DivAssign for Rational
[src]
fn div_assign(&mut self, rhs: Rational)
[src]
Performs the /=
operation.
impl DivAssign<i64> for Rational
[src]
fn div_assign(&mut self, n: i64)
[src]
Performs the /=
operation.
impl Div<Rational> for Rational
[src]
type Output = Rational
The resulting type after applying the /
operator.
fn div(self, rhs: Rational) -> Rational
[src]
Performs the /
operation.
impl Ord for Rational
[src]
fn cmp(&self, rhs: &Rational) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialOrd for Rational
[src]
fn partial_cmp(&self, rhs: &Rational) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more