1、定义
type_name(expression)
2、example
1 package main 2 3 import ( 4 "fmt" 5 ) 6 7 func main() { 8 var a = 10 9 var b = 100 10 var res float32 11 //类型转换-类型(表达式) 12 res = float32(a) / float32(b) 13 fmt.Println(res) 14 }
标签:类型转换,res,fmt,var,main,float32 From: https://www.cnblogs.com/shixiaogu/p/16869886.html