Skip to content

doc: Fix external mention of signum() return value regarding NaNs - #162576

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xkr47:fix/doc-signum-nan-return
Sep 10, 2026
Merged

doc: Fix external mention of signum() return value regarding NaNs#162576
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xkr47:fix/doc-signum-nan-return

Conversation

@xkr47

@xkr47 xkr47 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

is_sign_positive()/is_sign_negative() documentation refer to using signum() but misrepresent the return value of the latter; signum() returns a float so it cannot be false; signum() documentation documents it as returning a NaN in this case, so propagated that to these references.

@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 Sep 10, 2026
@rustbot

rustbot commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

r? @Darksonn

rustbot has assigned @Darksonn.
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: libs
  • libs expanded to 12 candidates
  • Random selection from Darksonn, JohnTitor, Mark-Simulacrum

@Darksonn Darksonn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pub const fn is_sign_negative(self) -> bool {
// IEEE754 says: isSignMinus(x) is true if and only if x has negative sign. isSignMinus
// applies to zeros and NaNs as well.
// SAFETY: This is just transmuting to get the sign bit, it's fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated but these SAFETY comments look stale

@rust-bors

rust-bors Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 88db34a has been approved by Darksonn

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 5. This pull request will be tested once the tree is reopened.

Reason for tree closure: git config problem again

@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 Sep 10, 2026
@Darksonn Darksonn added the A-floating-point Area: Floating point numbers and arithmetic label Sep 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 10, 2026
…=Darksonn

doc: Fix external mention of signum() return value regarding NaNs

`is_sign_positive()`/`is_sign_negative()` documentation refer to using `signum() ` but misrepresent the return value of the latter; `signum()` returns a float so it cannot be `false`; `signum()` documentation documents it as returning a NaN in this case, so propagated that to these references.
rust-bors Bot pushed a commit that referenced this pull request Sep 10, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #162581 (Subtree sync for rustc_codegen_cranelift)
 - #160831 (re-equate the object bound's trait ref with the goal's when considering object bounds)
 - #162057 (Some cleanups around fatal errors and delayed bugs)
 - #162437 (fix(traits): Remove expression references from index suggestions)
 - #162534 (Fix run-make/prune-link-args to work with MinGW)
 - #162576 (doc: Fix external mention of signum() return value regarding NaNs)
rust-bors Bot pushed a commit that referenced this pull request Sep 10, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #162581 (Subtree sync for rustc_codegen_cranelift)
 - #160831 (re-equate the object bound's trait ref with the goal's when considering object bounds)
 - #162057 (Some cleanups around fatal errors and delayed bugs)
 - #162437 (fix(traits): Remove expression references from index suggestions)
 - #162534 (Fix run-make/prune-link-args to work with MinGW)
 - #162576 (doc: Fix external mention of signum() return value regarding NaNs)
rust-bors Bot pushed a commit that referenced this pull request Sep 10, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #162581 (Subtree sync for rustc_codegen_cranelift)
 - #160831 (re-equate the object bound's trait ref with the goal's when considering object bounds)
 - #162057 (Some cleanups around fatal errors and delayed bugs)
 - #162437 (fix(traits): Remove expression references from index suggestions)
 - #162534 (Fix run-make/prune-link-args to work with MinGW)
 - #162554 (Attemped fix for home dir problem on `dist-aarch64-llvm-mingw`)
 - #162576 (doc: Fix external mention of signum() return value regarding NaNs)
@rust-bors
rust-bors Bot merged commit fbfe562 into rust-lang:main Sep 10, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 10, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 10, 2026
Rollup merge of #162576 - xkr47:fix/doc-signum-nan-return, r=Darksonn

doc: Fix external mention of signum() return value regarding NaNs

`is_sign_positive()`/`is_sign_negative()` documentation refer to using `signum() ` but misrepresent the return value of the latter; `signum()` returns a float so it cannot be `false`; `signum()` documentation documents it as returning a NaN in this case, so propagated that to these references.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-floating-point Area: Floating point numbers and arithmetic 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.

3 participants