-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: float64 formatting behaving differently than expected (and than documented) #18772
Comments
|
There's only so much we can say in a one-line summary. The full details of the precision are documented. I tend to think this is fine as is, unless someone can come up with a very short replacement for the current one-line summary. |
It may suffice to replace
with
|
CL https://golang.org/cl/37313 mentions this issue. |
What version of Go are you using (
go version
)?1.7.3
What operating system and processor architecture are you using (
go env
)?darwin amd64
What did you do?
https://play.golang.org/p/LEVTU7r4wX
What did you expect to see?
The %g-formatted (or %v) float64 number to be the same as either %f or %e, as per documentation.
What did you see instead?
The %g-formatted number was 24.849999999999998.
The text was updated successfully, but these errors were encountered: