about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJim Turner <git@turner.link>2021-03-01 15:49:05 -0500
committerJim Turner <git@turner.link>2021-03-01 15:54:00 -0500
commit77c0a48b7e19f1a8a8514ab48ffa7258a874ccb3 (patch)
tree5210faeccaf9d66052b4918f8e5b09cdb9b840f3
parent5233edcf1c7ee70ac25e4ec1115c3546f53d8a2d (diff)
Fix inequality in docs for div_euclid
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.
-rw-r--r--library/core/src/num/int_macros.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs
index ce9dca39d0e..79737b48d79 100644
--- a/library/core/src/num/int_macros.rs
+++ b/library/core/src/num/int_macros.rs
@@ -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.
         ///