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

write_csv() uses overly large precision with some floating-point numbers #1441

Closed
krlmlr opened this issue Oct 1, 2022 · 1 comment
Closed

Comments

@krlmlr
Copy link
Member

krlmlr commented Oct 1, 2022

This seems rare but surprising. Tested with 70d0eb4.

library(readr)
write_csv(data.frame(a = 1.3498), stdout())
#> a
#> 1.3498000000000001
write_csv(data.frame(a = 2.6996), stdout())
#> a
#> 2.6996000000000002
identical(1.3498000000000001, 1.3498)
#> [1] TRUE
identical(2.6996000000000002, 2.6996)
#> [1] TRUE

Created on 2022-10-01 with reprex v2.0.2

@MarekGierlinski
Copy link

I think I stumbled upon the same issue in a different context. See #1502.

@hadley hadley closed this as completed Jul 31, 2023
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

No branches or pull requests

3 participants