]> git.lizzy.rs Git - rust.git/commitdiff
Clarify wording on f64::round() and f32::round()
authorWilfred Hughes <me@wilfred.me.uk>
Mon, 6 Feb 2023 03:38:08 +0000 (19:38 -0800)
committerWilfred Hughes <me@wilfred.me.uk>
Mon, 6 Feb 2023 03:44:21 +0000 (19:44 -0800)
"Round half-way cases" is a little confusing (it's a 'garden path
sentence' as it's not immediately clear whether round is an adjective
or verb).

Make this sentence longer and clearer.

library/std/src/f32.rs
library/std/src/f64.rs

index 4e30076246314edb50cdf017b1f1aa00878a3d12..6b1f0cba82dfc877cddfba31465fcb28af5798ad 100644 (file)
@@ -69,8 +69,8 @@ pub fn ceil(self) -> f32 {
         unsafe { intrinsics::ceilf32(self) }
     }
 
-    /// Returns the nearest integer to `self`. Round half-way cases away from
-    /// `0.0`.
+    /// Returns the nearest integer to `self`. If a value is half-way between two
+    /// integers, round away from `0.0`.
     ///
     /// # Examples
     ///
index ec67fdad4f726f50ac11d503701fef61ab8664b5..16359766b510d865e6c8846fe5a6c966fa488429 100644 (file)
@@ -69,8 +69,8 @@ pub fn ceil(self) -> f64 {
         unsafe { intrinsics::ceilf64(self) }
     }
 
-    /// Returns the nearest integer to `self`. Round half-way cases away from
-    /// `0.0`.
+    /// Returns the nearest integer to `self`. If a value is half-way between two
+    /// integers, round away from `0.0`.
     ///
     /// # Examples
     ///