Skip to content

docs(ch03-02): clarify unsigned integers include zero (#4773)#4775

Open
Dodothereal wants to merge 1 commit into
rust-lang:mainfrom
Dodothereal:fix/issue-4773-unsigned-integers-definition
Open

docs(ch03-02): clarify unsigned integers include zero (#4773)#4775
Dodothereal wants to merge 1 commit into
rust-lang:mainfrom
Dodothereal:fix/issue-4773-unsigned-integers-definition

Conversation

@Dodothereal

Copy link
Copy Markdown

Fixes #4773

Summary

Rust's unsigned integer types can represent zero and positive numbers
(non-negative), not just positive numbers. The current phrasing in
Chapter 3.2 ('only ever be positive') is mathematically imprecise.

This commit adopts the wording suggested in the issue: 'always
non-negative (that is, zero or positive), so it can be represented
without a sign'. Doc-only edit.

Test plan

  • 'dprint check' on the touched file reports clean.
  • 'git diff' reviewed: single-file 5-line diff, no whitespace drift.
  • Suggested text from the issue body is used verbatim.

AI assistance

Change prepared with help from an AI coding assistant. The diff was reviewed and edited before submission.

Fixes rust-lang#4773: unsigned integers can represent zero and positive numbers
(non-negative), not just positive numbers. The previous phrasing was
mathematically imprecise and could confuse learners.

Replaced 'only ever be positive and can therefore be represented
without a sign' with 'always non-negative (that is, zero or positive),
so it can be represented without a sign' per the issue's suggested
fix.

Co-authored-by: AI assistance (Dodothereal) <129273127+Dodothereal@users.noreply.github.com>
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.

Fix imprecise definition of unsigned integers in Chapter 3.2 (Scalar Types)

1 participant