You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
ianlancetaylor
changed the title
float64 formatting behaving differently than expected (and than documented)
fmt: float64 formatting behaving differently than expected (and than documented)
Jan 24, 2017
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.
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: