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
xiaoyang-chen
changed the title
fmt: get wrong data when using "%.30f" in fmt.Sprintf
fmt: get wrong result when using "%.30f" in fmt.Sprintf
Aug 24, 2021
What version of Go are you using (
go version
)?go playground. and. go version go1.16.6 darwin/amd64
Does this issue reproduce with the latest release?
unknown, reproduce in go playground and go version go1.16.6 darwin/amd64
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
fmt.Println(fmt.Sprintf("%.30f", 5.400000*float64(0.400000)))
https://play.golang.org/p/o4ARzVQfsw_0
What did you expect to see?
get. 2.160000000000000000000000000000
What did you see instead?
get 2.160000000000000142108547152020
The text was updated successfully, but these errors were encountered: