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

printf("%.f") should use zero precision, not default precision #490

Closed
wants to merge 5 commits into from

Conversation

manylegged
Copy link
Contributor

Really minor change to make fmt::printf better conform to the man page when omitting the optional precision digit

An optional period, `.', followed by an optional digit string giving a precision which specifies the number of digits to appear after the decimal point, for e and f formats, or the maximum number of bytes to be printed from a string; if the digit string is missing, the precision is treated as zero;

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Could you please add a test case to printf-test.cc?

@manylegged
Copy link
Contributor Author

I added a test for this zero-precision case, and also for the related case with non-zero precision.

@vitaut
Copy link
Contributor

vitaut commented Apr 5, 2017

The new tests seem to be failing.

@manylegged
Copy link
Contributor Author

Whoops, forgot about rounding... Should be passing now. I actually installed cmake etc. and ran it this time...

… formatter. fix compilation when custom formatting a type with alignment restrictions (e.g. an sse2 vector type)
@vitaut
Copy link
Contributor

vitaut commented Apr 8, 2017

Merged the first 3 commits (squashed) in cbac016, thanks!

The last two commits seem unrelated, please submit as a separate PR.

@vitaut vitaut closed this Apr 8, 2017
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.

2 participants