Added precision and variable precision#11
Open
HansAnderson wants to merge 7 commits intocjlano:masterfrom
Open
Added precision and variable precision#11HansAnderson wants to merge 7 commits intocjlano:masterfrom
HansAnderson wants to merge 7 commits intocjlano:masterfrom
Conversation
added 7 commits
November 28, 2015 11:27
This makes the printf.c and sprintf.c files easier to diff.
One of the sprintf.c test cases is failing, which needs to be resolved.
All features of precision should work, except that numbers get limited to 10 or 20 characters for precision (depending on if LONG is supported). This seemed like a reasonable complexity trade-off, since it would allow precision-based zero padding to the maximum character width of the largest integer type.
This standard format string feature allows the width or precision to be provided as an additional argument.
As a side effect, integer precision is no longer bounded by BF_MAX. Precision should now be fully compatible with the standard printf.
If zero padding is specified when either left-justify or precision are used, the zero padding should be ignored. The '*' specifiers can be integers, where negatives are handled in specific ways. The prec_used flag is no longer needed with these changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tests were also cleaned up (and expanded for precision).