-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Support single precision floats in grisu formatting #1336
Comments
As I see, floating format with "{}" and GRISU is not more compatible with
outputs
(fmtlib 6.0.0, GRISU, VisualStudio 2019 16.3) |
Please use a separate issue to discuss that. #1033 is related, although it does not talk about the default |
Right. This is also needed for compatibility with |
Currently
fmt::format("{}", 0.1f)
with grisu produces0.10000000149011612
(as would have been expected fromdouble(0.1f)
) rather than0.1
.Single precision formatting differs from double precision only in the calculation of the boundaries: https://github.com/google/double-conversion/blob/v3.1.5/double-conversion/fast-dtoa.cc#L525-L536
The text was updated successfully, but these errors were encountered: