From 3d15223445cb4e48e97180e9c4e84f0e72f0a504 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Thu, 13 Nov 2025 23:00:13 -0800 Subject: [PATCH] Fix division syntax in doc comments `mod` is a keyword in Rust, and since we're talking about remainders we should be using division syntax here. --- library/core/src/num/f128.rs | 2 +- library/core/src/num/f16.rs | 2 +- library/core/src/num/int_macros.rs | 2 +- library/core/src/num/uint_macros.rs | 2 +- library/std/src/num/f32.rs | 2 +- library/std/src/num/f64.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/core/src/num/f128.rs b/library/core/src/num/f128.rs index e7101537b298f..bb5734275e165 100644 --- a/library/core/src/num/f128.rs +++ b/library/core/src/num/f128.rs @@ -1704,7 +1704,7 @@ impl f128 { q } - /// Calculates the least nonnegative remainder of `self (mod rhs)`. + /// Calculates the least nonnegative remainder of `self / rhs`. /// /// In particular, the return value `r` satisfies `0.0 <= r < rhs.abs()` in /// most cases. However, due to a floating point round-off error it can diff --git a/library/core/src/num/f16.rs b/library/core/src/num/f16.rs index aa8342a22ad58..775e7399bb399 100644 --- a/library/core/src/num/f16.rs +++ b/library/core/src/num/f16.rs @@ -1679,7 +1679,7 @@ impl f16 { q } - /// Calculates the least nonnegative remainder of `self (mod rhs)`. + /// Calculates the least nonnegative remainder of `self / rhs`. /// /// In particular, the return value `r` satisfies `0.0 <= r < rhs.abs()` in /// most cases. However, due to a floating point round-off error it can diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 70e764de90698..7773a4237b58c 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -3124,7 +3124,7 @@ macro_rules! int_impl { } - /// Calculates the least nonnegative remainder of `self (mod rhs)`. + /// Calculates the least nonnegative remainder of `self / rhs`. /// /// This is done as if by the Euclidean division algorithm -- given /// `r = self.rem_euclid(rhs)`, the result satisfies diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index d38d3a1a5ad46..db9e3ab699a6b 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -3399,7 +3399,7 @@ macro_rules! uint_impl { } - /// Calculates the least remainder of `self (mod rhs)`. + /// Calculates the least remainder of `self / rhs`. /// /// Since, for the positive integers, all common /// definitions of division are equal, this diff --git a/library/std/src/num/f32.rs b/library/std/src/num/f32.rs index c9e192201affc..f8d2d2d49cf97 100644 --- a/library/std/src/num/f32.rs +++ b/library/std/src/num/f32.rs @@ -252,7 +252,7 @@ impl f32 { core::f32::math::div_euclid(self, rhs) } - /// Calculates the least nonnegative remainder of `self (mod rhs)`. + /// Calculates the least nonnegative remainder of `self / rhs`. /// /// In particular, the return value `r` satisfies `0.0 <= r < rhs.abs()` in /// most cases. However, due to a floating point round-off error it can diff --git a/library/std/src/num/f64.rs b/library/std/src/num/f64.rs index 11874f9280f02..58b6d4a9a9906 100644 --- a/library/std/src/num/f64.rs +++ b/library/std/src/num/f64.rs @@ -252,7 +252,7 @@ impl f64 { core::f64::math::div_euclid(self, rhs) } - /// Calculates the least nonnegative remainder of `self (mod rhs)`. + /// Calculates the least nonnegative remainder of `self / rhs`. /// /// In particular, the return value `r` satisfies `0.0 <= r < rhs.abs()` in /// most cases. However, due to a floating point round-off error it can