Skip to content

Commit

Permalink
Clarify wording on f64::round() and f32::round()
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
Wilfred committed Feb 6, 2023
1 parent 14ea63a commit 4a7a9b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/std/src/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ impl 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
///
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ impl 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
///
Expand Down

0 comments on commit 4a7a9b4

Please sign in to comment.