-
Notifications
You must be signed in to change notification settings - Fork 18k
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
fmt: inconsistency in 0 padded formatting of Inf and Nan float values #14421
Comments
It's just saying, "Oooooh, a Nan!". Might be a consequence of https://go-review.googlesource.com/19721 or might be old. Should be easy to fix regardless. |
The NaN issue has existed since Go 1.0. But
the Inf case has changed a little bit:
go version go1
00000000000000000NaN
0000000000000000+Inf
0000000000000000-Inf
go version go1.1.2 linux/amd64
00000000000000000NaN
0000000000000000+Inf
0000000000000000-Inf
go version go1.2.1 linux/amd64
00000000000000000NaN
+0000000000000000Inf
-0000000000000000Inf
go version go1.2.2 linux/amd64
00000000000000000NaN
+0000000000000000Inf
-0000000000000000Inf
go version go1.3 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version go1.3.3 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version go1.4 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version go1.4.1 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version go1.4.3 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version go1.5 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version go1.5.3 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version go1.6 linux/amd64
00000000000000000NaN
+Inf
-Inf
go version devel +e6d6ad4 Sat Feb 20 20:16:27 2016 +0000 linux/amd64
00000000000000000NaN
+Inf
-Inf
so Go 1.3 fixes the Inf problem, but the NaN problem persists.
|
Writing the patch that rob mentioned made me aware of the NaN case. |
CL https://golang.org/cl/19723 mentions this issue. |
For e.g. "%020f" Inf is not 0 padded but NaN is.
The text was updated successfully, but these errors were encountered: