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) }
本文共 279 字,大约阅读时间需要 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) }
转载于:https://www.cnblogs.com/oxspirt/p/7059515.html