mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
auto merge of #16775 : jbcrail/rust/fix-rational-docs, r=pcwalton
Minor corrections to Rational documentation.
This commit is contained in:
@@ -154,7 +154,7 @@ pub fn trunc(&self) -> Ratio<T> {
|
||||
Ratio::from_integer(self.numer / self.denom)
|
||||
}
|
||||
|
||||
///Returns the fractional part of a number.
|
||||
/// Returns the fractional part of a number.
|
||||
#[inline]
|
||||
pub fn fract(&self) -> Ratio<T> {
|
||||
Ratio::new_raw(self.numer % self.denom, self.denom.clone())
|
||||
@@ -243,7 +243,7 @@ fn $method(&self, rhs: &Ratio<T>) -> Ratio<T> {
|
||||
}
|
||||
}
|
||||
|
||||
// a/b + c/d = (a*d + b*c)/(b*d
|
||||
// a/b + c/d = (a*d + b*c)/(b*d)
|
||||
arith_impl!(impl Add, add)
|
||||
|
||||
// a/b - c/d = (a*d - b*c)/(b*d)
|
||||
|
||||
Reference in New Issue
Block a user