Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd1c998

Browse files
authored
Rollup merge ofrust-lang#126468 - RalfJung:euclid, r=Mark-Simulacrum
div_euclid, rem_euclid: clarify/extend documentation
2 parents2730879 +3909d51 commitcd1c998

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎core/src/num/int_macros.rs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,8 +2784,10 @@ macro_rules! int_impl {
27842784
///
27852785
/// In other words, the result is `self / rhs` rounded to the integer `q`
27862786
/// such that `self >= q * rhs`.
2787-
/// If `self > 0`, this is equal to round towards zero (the default in Rust);
2788-
/// if `self < 0`, this is equal to round towards +/- infinity.
2787+
/// If `self > 0`, this is equal to rounding towards zero (the default in Rust);
2788+
/// if `self < 0`, this is equal to rounding away from zero (towards +/- infinity).
2789+
/// If `rhs > 0`, this is equal to rounding towards -infinity;
2790+
/// if `rhs < 0`, this is equal to rounding towards +infinity.
27892791
///
27902792
/// # Panics
27912793
///
@@ -2823,8 +2825,8 @@ macro_rules! int_impl {
28232825
/// Calculates the least nonnegative remainder of `self (mod rhs)`.
28242826
///
28252827
/// This is done as if by the Euclidean division algorithm -- given
2826-
/// `r = self.rem_euclid(rhs)`,`self = rhs * self.div_euclid(rhs) + r`, and
2827-
/// `0 <= r < abs(rhs)`.
2828+
/// `r = self.rem_euclid(rhs)`,the result satisfies
2829+
/// `self = rhs * self.div_euclid(rhs) + r` and `0 <= r < abs(rhs)`.
28282830
///
28292831
/// # Panics
28302832
///

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp