Consider these two cases:
fmt.Println(912 * 0.01)
fmt.Println(float64(912) * 0.01)
The second one prints 9.120000000000001, which is actually fine, I understand why that is happening.
However, why does the first line print 9.12, without the …01 at the end? Does Go multiply the two untyped constants and simply replace them with a 9.12 literal when compiling?
See Question&Answers more detail:os