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

Correct numeric precision comment #1666

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

capnrefsmmat
Copy link

It's not correct to say R uses numbers with "a fixed number of decimal places"; that implies fixed-point arithmetic, but R uses floating-point arithmetic, where the number of decimal places depends on the scale of the variable. Numbers near 0 are represented with more decimal places than very large numbers.

It's fair to say the precision is finite, and that's the real problem, as the precision isn't enough to represent the numbers exactly (and can't be, for sqrt(2)).

It's not correct to say R uses numbers with "a fixed number of decimal places"; that implies fixed-point arithmetic, but R uses floating-point arithmetic, where the number of decimal places depends on the scale of the variable. Numbers near 0 are represented with more decimal places than very large numbers.

It's fair to say the precision is finite, and that's the real problem, as the precision isn't enough to represent the numbers exactly (and can't be, for sqrt(2)).
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