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

Fix incorrect zero padding of inf and NaN #77

Merged
merged 2 commits into from
Nov 11, 2020
Merged

Conversation

c42f
Copy link
Owner

@c42f c42f commented Nov 9, 2020

We now follow the rule: if the type is a non-finite floating point type,
and the stream fill has been zero padded, then reset it to ' '.

This prevents zero-padded numbers which turn out to be nan/inf from
being oddly formatted with leading zeros.

Should fix #76

We now follow the rule: if the type is a non-finite floating point type,
*and* the stream fill has been zero padded, then reset it to ' '.

This prevents zero-padded numbers which turn out to be nan/inf from
being oddly formatted with leading zeros.
@c42f
Copy link
Owner Author

c42f commented Nov 9, 2020

Should fix #76

@nigels-com
Copy link
Contributor

Looks good!

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.

Formatting NaN or infinity with explicit precision injects spurious zeros
2 participants