Skip to content

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

Description

@150410awe

URL: https://rust-book.cs.brown.edu/ch03-02-data-types.html#scalar-types

Issue: Imprecise definition of unsigned integers (Chapter 3.2)

Current wording ():
In the section introducing integer types, the book says:

"or whether it will only ever be positive and can therefore be represented without a sign (unsigned)."

Problem:
Mathematically, zero is neither positive nor negative. Unsigned integers can represent zero and positive numbers (i.e., non-negative numbers, >= 0), not just "positive" numbers. Using "positive" here is mathematically incorrect and may confuse learners.

Suggested fix:
Change the phrasing to:

"Or it's always non-negative (that is, zero or positive), so it doesn't need a sign (unsigned)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions