There is no float
type. Looks like you want float64
. You could also use float32
if you only need a single-precision floating point value.
package mainimport "fmt" func main() { i := 5 f := float64(i) fmt.Printf("f is %f\n", f) }
本文共 228 字,大约阅读时间需要 1 分钟。
There is no float
type. Looks like you want float64
. You could also use float32
if you only need a single-precision floating point value.
package mainimport "fmt" func main() { i := 5 f := float64(i) fmt.Printf("f is %f\n", f) }
转载地址:http://cygxl.baihongyu.com/