Skip to content

Commit

Permalink
Fix inequality in docs for div_euclid
Browse files Browse the repository at this point in the history
This commit fixes the statement of the inequality that the Euclidean
remainder satisfies. (The remainder is guaranteed to be less than
abs(rhs), not rhs.) It also rewords the documentation to make it a
little easier to read.
  • Loading branch information
jturner314 committed Mar 1, 2021
1 parent 5233edc commit 77c0a48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/core/src/num/int_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1589,11 +1589,11 @@ macro_rules! int_impl {

/// Calculates the quotient of Euclidean division of `self` by `rhs`.
///
/// This computes the integer `n` such that `self = n * rhs + self.rem_euclid(rhs)`,
/// with `0 <= self.rem_euclid(rhs) < rhs`.
/// This computes the integer `q` such that `self = q * rhs + r`, with
/// `r = self.rem_euclid(rhs)` and `0 <= r < abs(rhs)`.
///
/// In other words, the result is `self / rhs` rounded to the integer `n`
/// such that `self >= n * rhs`.
/// In other words, the result is `self / rhs` rounded to the integer `q`
/// such that `self >= q * rhs`.
/// If `self > 0`, this is equal to round towards zero (the default in Rust);
/// if `self < 0`, this is equal to round towards +/- infinity.
///
Expand Down

0 comments on commit 77c0a48

Please sign in to comment.