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

Output of fmt doesn't match C's printf for 'g' #1376

Closed
Queueless opened this issue Oct 25, 2019 · 1 comment
Closed

Output of fmt doesn't match C's printf for 'g' #1376

Queueless opened this issue Oct 25, 2019 · 1 comment

Comments

@Queueless
Copy link

Queueless commented Oct 25, 2019

I'm replacing a home grown safe format library with fmt and here is a test case where the output doesn't match:

sprintf("%g", 0.000000456) -> 4.56e-07
fmt::sprintf("%g", 0.000000456) -> 4.56000e-07

I found that FMT_USE_GRISU set to zero fixes my problem, so this algorithm appears to not generate equivalent output.

@vitaut
Copy link
Contributor

vitaut commented Oct 28, 2019

Fixed in 40414b3. Thanks for reporting.

@vitaut vitaut closed this as completed Oct 28, 2019
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

2 participants