rust-lang / book

The Rust Programming Language

Home Page:https://doc.rust-lang.org/book/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace single-precision with actual numerical precision

rillig opened this issue · comments

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    • precision
  • I have checked the latest main branch to see if this has already been fixed, in this file:
    • src/ch03-02-data-types.md

Description of the problem:
The text says:

The f32 type is a single-precision float, and f64 has double precision.

These terms are from IEEE 754-1985 and have been superceded by IEEE 754-2008, which has renamed the types single and double to the more expressive binary32 and binary64.

Suggested fix:

  • Reword the above quote to make it clear why this sentence is useful to a reader.
  • Or reword the sentence stating the actual precision in decimal places, something like:
    • f32 has about 7 decimal places of precision, f64 has about 15 decimal places of precision.
  • Or, even better, remove the sentence, as it is largely redundant.