Skip to content

Improve doc comments for f32::ceil() and f32::floor()#156392

Open
Wilfred wants to merge 1 commit intorust-lang:mainfrom
Wilfred:float_ceil_docs
Open

Improve doc comments for f32::ceil() and f32::floor()#156392
Wilfred wants to merge 1 commit intorust-lang:mainfrom
Wilfred:float_ceil_docs

Conversation

@Wilfred
Copy link
Copy Markdown
Contributor

@Wilfred Wilfred commented May 10, 2026

Previously ::floor() included an example showing behaviour for negative values, but ::ceil() did not. Ensure both have examples of the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 10, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 10, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, nia-e

@Wilfred Wilfred changed the title Improve doc comments for f32::ceil() and f64::floor() Improve doc comments for f32::ceil() and f32::floor() May 10, 2026
Previously ::floor() included an example showing behaviour for
negative values, but ::ceil() did not. Ensure both have examples of
the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
@Wilfred Wilfred force-pushed the float_ceil_docs branch from 769d19d to e8eb80b Compare May 10, 2026 11:25
@Mark-Simulacrum
Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 10, 2026

📌 Commit e8eb80b has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 10, 2026
…mulacrum

Improve doc comments for f32::ceil() and f32::floor()

Previously ::floor() included an example showing behaviour for negative values, but ::ceil() did not. Ensure both have examples of the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
rust-bors Bot pushed a commit that referenced this pull request May 10, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #156196 (Include vendored sources in the rust-src component)
 - #156357 (tests: ip*_properties: avoid parsing the IP over and over again)
 - #156389 (prepare fs tests for miri)
 - #153975 (remove forever-deprecated and hidden `f64` methods)
 - #156147 (Update ICU4X to 2.2)
 - #156375 (kernel_copy tests: properly join background threads)
 - #156282 (Update `sysinfo` version to `0.39.0`)
 - #156392 (Improve doc comments for f32::ceil() and f32::floor())
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 11, 2026
…mulacrum

Improve doc comments for f32::ceil() and f32::floor()

Previously ::floor() included an example showing behaviour for negative values, but ::ceil() did not. Ensure both have examples of the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
rust-bors Bot pushed a commit that referenced this pull request May 11, 2026
Rollup of 6 pull requests

Successful merges:

 - #153975 (remove forever-deprecated and hidden `f64` methods)
 - #156147 (Update ICU4X to 2.2)
 - #156375 (kernel_copy tests: properly join background threads)
 - #155946 (Refuse to push changes with a dirty git client)
 - #156282 (Update `sysinfo` version to `0.39.0`)
 - #156392 (Improve doc comments for f32::ceil() and f32::floor())
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 11, 2026
…mulacrum

Improve doc comments for f32::ceil() and f32::floor()

Previously ::floor() included an example showing behaviour for negative values, but ::ceil() did not. Ensure both have examples of the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 11, 2026
…mulacrum

Improve doc comments for f32::ceil() and f32::floor()

Previously ::floor() included an example showing behaviour for negative values, but ::ceil() did not. Ensure both have examples of the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
rust-bors Bot pushed a commit that referenced this pull request May 11, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #156147 (Update ICU4X to 2.2)
 - #156375 (kernel_copy tests: properly join background threads)
 - #155946 (Refuse to push changes with a dirty git client)
 - #156282 (Update `sysinfo` version to `0.39.0`)
 - #156384 (Remove some dead code for dumping MIR for a single DefId)
 - #156392 (Improve doc comments for f32::ceil() and f32::floor())
 - #156411 (bootstrap: Don't panic on `x install --set build.extended=true`)
@RalfJung
Copy link
Copy Markdown
Member

RalfJung commented May 11, 2026

Cc @tgross35 -- f16 and f128 docs are getting out of sync from f32/f64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants