Skip to content

Commit 455bc95

Browse files
committed
fix nits
1 parent 66bb34c commit 455bc95

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libcore/num/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,7 @@ $EndFeature, "
17401740
concat!("Calculates the quotient of Euclidean division of `self` by `rhs`.
17411741
17421742
This computes the integer `n` such that `self = n * rhs + self.rem_euclid(rhs)`,
1743-
with the `0 <= self.rem_euclid(rhs) < rhs`.
1743+
with `0 <= self.rem_euclid(rhs) < rhs`.
17441744
17451745
In other words, the result is `self / rhs` rounded to the integer `n`
17461746
such that `self >= n * rhs`.
@@ -1781,7 +1781,9 @@ assert_eq!((-a).div_euclid(-b), 2); // -7 >= -4 * 2
17811781
doc_comment! {
17821782
concat!("Calculates the least nonnegative remainder of `self (mod rhs)`.
17831783
1784-
This is done as if by the Euclidean division algorithm.
1784+
This is done as if by the Euclidean division algorithm -- given
1785+
`r = self.rem_euclid(rhs)`, `self = rhs * self.div_euclid(rhs) + r`, and
1786+
`0 <= r < abs(rhs)`.
17851787
17861788
# Panics
17871789

0 commit comments

Comments
 (0)