golang.org/toolchain@v0.0.1-go1.9rc2.windows-amd64/blog/content/constants/float2.go (about) 1 // +build OMIT 2 3 package main 4 5 import "fmt" 6 7 func main() { 8 const Zero = 0.0 9 const TypedZero float64 = 0.0 10 // START OMIT 11 var f32 float32 12 f32 = 0.0 13 f32 = Zero // OK: Zero is untyped 14 f32 = TypedZero // Bad: TypedZero is float64 not float32. 15 fmt.Println(f32) 16 // STOP OMIT 17 }