Skip to content

Clarify signed-zero behavior in Signed predicate documentation - #387

Open
RanaPriyansh wants to merge 1 commit into
rust-num:mainfrom
RanaPriyansh:docs/signed-zero-385
Open

RanaPriyansh wants to merge 1 commit into
rust-num:mainfrom
RanaPriyansh:docs/signed-zero-385

Conversation

@RanaPriyansh

Copy link
Copy Markdown

Signed::is_positive and Signed::is_negative document zero as neither positive nor negative. For f32 and f64, the existing implementations instead inspect the sign bit, including signed zero.

Distinguish integer and floating-point behavior in the trait documentation. Add doctests that call Signed explicitly for both float types and integer-zero controls. Runtime behavior is unchanged.

Related to #385.

Verification on Rust 1.94.1:

  • Formatting check.
  • Documentation builds with RUSTDOCFLAGS='-D warnings' for default features, no default features, and libm without default features.
  • Doctests in those same three configurations.
  • The repository's ci/test_full.sh feature-matrix script passed before the final wording-only precision edit. Documentation and doctests were rerun on the final source.

The upstream MSRV and platform matrix was not run locally. AI-assisted implementation and verification; independent agent review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant