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: don't zero pad Inf or NaN #53785

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Conversation

jmkuhn
Copy link
Contributor

@jmkuhn jmkuhn commented Mar 19, 2024

We currently have

julia> @sprintf("%07f", -Inf)
"-000Inf"

julia> @sprintf("%07f", NaN)
"0000NaN"

With this PR

julia> @sprintf("%07f", -Inf)
"   -Inf"

julia> @sprintf("%07f", NaN)
"    NaN"

which is the same as Julia 1.5.4 and agrees with the C standard.

@JeffBezanson
Copy link
Member

Thank you; I wonder why that regressed in 1.6.

@jmkuhn
Copy link
Contributor Author

jmkuhn commented Mar 19, 2024

Printf was completely rewritten #32859 for 1.6

@JeffBezanson JeffBezanson merged commit 55afecc into JuliaLang:master Mar 20, 2024
5 of 7 checks passed
@JeffBezanson JeffBezanson added bugfix This change fixes an existing bug display and printing Aesthetics and correctness of printed representations of objects. labels Mar 20, 2024
@jmkuhn jmkuhn deleted the zeropad branch March 21, 2024 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants