Skip to content

Commit ece87c3

Browse files
committed
Address nits and tidy errors.
1 parent 9255bbd commit ece87c3

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

src/libcore/num/mod.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,8 @@ $EndFeature, "
634634
}
635635

636636
doc_comment! {
637-
concat!("Checked Euclidean division. Computes `self.div_euc(rhs)`, returning `None` if `rhs == 0`
638-
or the division results in overflow.
637+
concat!("Checked Euclidean division. Computes `self.div_euc(rhs)`,
638+
returning `None` if `rhs == 0` or the division results in overflow.
639639
640640
# Examples
641641
@@ -1047,8 +1047,8 @@ $EndFeature, "
10471047
}
10481048

10491049
doc_comment! {
1050-
concat!("Wrapping Euclidean division. Computes `self.div_euc(rhs)`, wrapping around at the
1051-
boundary of the type.
1050+
concat!("Wrapping Euclidean division. Computes `self.div_euc(rhs)`,
1051+
wrapping around at the boundary of the type.
10521052
10531053
The only case where such wrapping can occur is when one divides `MIN / -1` on a signed type (where
10541054
`MIN` is the negative minimal value for the type); this is equivalent to `-MIN`, a positive value
@@ -1462,7 +1462,7 @@ $EndFeature, "
14621462

14631463

14641464
doc_comment! {
1465-
concat!("Calculates the modulo of Euclidean divsion `self.mod_euc(rhs)`.
1465+
concat!("Calculates the remainder `self.mod_euc(rhs)` by Euclidean division.
14661466
14671467
Returns a tuple of the remainder after dividing along with a boolean indicating whether an
14681468
arithmetic overflow would occur. If an overflow would occur then 0 is returned.
@@ -1691,8 +1691,8 @@ $EndFeature, "
16911691
doc_comment! {
16921692
concat!("Calculates the quotient of Euclidean division of `self` by `rhs`.
16931693
1694-
This computes the integer n such that `self = n * rhs + self.mod_euc(rhs)`.
1695-
In other words, the result is `self / rhs` rounded to the integer n
1694+
This computes the integer `n` such that `self = n * rhs + self.mod_euc(rhs)`.
1695+
In other words, the result is `self / rhs` rounded to the integer `n`
16961696
such that `self >= n * rhs`.
16971697
16981698
# Panics
@@ -1727,7 +1727,7 @@ $EndFeature, "
17271727

17281728

17291729
doc_comment! {
1730-
concat!("Calculates the modulo `self mod rhs` by Euclidean division.
1730+
concat!("Calculates the remainder `self mod rhs` by Euclidean division.
17311731
17321732
In particular, the result `n` satisfies `0 <= n < rhs.abs()`.
17331733
@@ -2720,7 +2720,7 @@ Basic usage:
27202720
#[unstable(feature = "euclidean_division", issue = "49048")]
27212721
#[inline]
27222722
pub fn wrapping_div_euc(self, rhs: Self) -> Self {
2723-
self.div_euc(rhs)
2723+
self / rhs
27242724
}
27252725
}
27262726

@@ -3018,7 +3018,8 @@ This function will panic if `rhs` is 0.
30183018
Basic usage
30193019
30203020
```
3021-
", $Feature, "assert_eq!(5", stringify!($SelfT), ".overflowing_div_euc(2), (2, false));", $EndFeature, "
3021+
", $Feature, "assert_eq!(5", stringify!($SelfT), ".overflowing_div_euc(2), (2, false));",
3022+
$EndFeature, "
30223023
```"),
30233024
#[inline]
30243025
#[unstable(feature = "euclidean_division", issue = "49048")]
@@ -3054,7 +3055,7 @@ Basic usage
30543055
}
30553056

30563057
doc_comment! {
3057-
concat!("Calculates the modulo of Euclidean division of `self.mod_euc(rhs)`.
3058+
concat!("Calculates the remainder `self.mod_euc(rhs)` by Euclidean division.
30583059
30593060
Returns a tuple of the modulo after dividing along with a boolean
30603061
indicating whether an arithmetic overflow would occur. Note that for
@@ -3070,7 +3071,8 @@ This function will panic if `rhs` is 0.
30703071
Basic usage
30713072
30723073
```
3073-
", $Feature, "assert_eq!(5", stringify!($SelfT), ".overflowing_mod_euc(2), (1, false));", $EndFeature, "
3074+
", $Feature, "assert_eq!(5", stringify!($SelfT), ".overflowing_mod_euc(2), (1, false));",
3075+
$EndFeature, "
30743076
```"),
30753077
#[inline]
30763078
#[unstable(feature = "euclidean_division", issue = "49048")]
@@ -3259,7 +3261,7 @@ $EndFeature, "
32593261

32603262

32613263
doc_comment! {
3262-
concat!("Calculates the Euclidean modulo `self mod rhs`.
3264+
concat!("Calculates the remainder `self mod rhs` by Euclidean division.
32633265
32643266
For unsigned types, this is just the same as `self % rhs`.
32653267

src/libstd/f32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ impl f32 {
331331

332332
/// Calculates Euclidean division, the matching method for `mod_euc`.
333333
///
334-
/// This computes the integer n such that
334+
/// This computes the integer `n` such that
335335
/// `self = n * rhs + self.mod_euc(rhs)`.
336-
/// In other words, the result is `self / rhs` rounded to the integer n
336+
/// In other words, the result is `self / rhs` rounded to the integer `n`
337337
/// such that `self >= n * rhs`.
338338
///
339339
/// ```

src/libstd/f64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ impl f64 {
317317

318318
/// Calculates Euclidean division, the matching method for `mod_euc`.
319319
///
320-
/// This computes the integer n such that
320+
/// This computes the integer `n` such that
321321
/// `self = n * rhs + self.mod_euc(rhs)`.
322-
/// In other words, the result is `self / rhs` rounded to the integer n
322+
/// In other words, the result is `self / rhs` rounded to the integer `n`
323323
/// such that `self >= n * rhs`.
324324
///
325325
/// ```

0 commit comments

Comments
 (0)