Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace single-precision with actual numerical precision #3818

Closed
rillig opened this issue Jan 20, 2024 · 1 comment · Fixed by #4114
Closed

Replace single-precision with actual numerical precision #3818

rillig opened this issue Jan 20, 2024 · 1 comment · Fixed by #4114
Milestone

Comments

@rillig
Copy link

rillig commented Jan 20, 2024

  • 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.
@chriskrycho chriskrycho added this to the ch3 milestone Mar 29, 2024
@chriskrycho
Copy link
Contributor

Indeed—and the 2008 revision by the 2019 revision! Which continues the use of the binary32 etc. naming. I think it’s probably helpful to indicate that it follows the standard but may not need the extra detail—I don’t imagine anyone would have any trouble inferring that f32 maps to binary32 etc.

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 a pull request may close this issue.

2 participants