Skip to content

Printf: don't zero pad Inf or NaN#53785

Merged
JeffBezanson merged 1 commit into
JuliaLang:masterfrom
jmkuhn:zeropad
Mar 20, 2024
Merged

Printf: don't zero pad Inf or NaN#53785
JeffBezanson merged 1 commit into
JuliaLang:masterfrom
jmkuhn:zeropad

Conversation

@jmkuhn

@jmkuhn jmkuhn commented Mar 19, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

Thank you; I wonder why that regressed in 1.6.

@jmkuhn

jmkuhn commented Mar 19, 2024

Copy link
Copy Markdown
Contributor Author

Printf was completely rewritten #32859 for 1.6

@JeffBezanson
JeffBezanson merged commit 55afecc into JuliaLang:master Mar 20, 2024
@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