package mainimport ( "fmt")const ( B float64 = 1 << (iota * 10) KB MB GB)func main() { fmt.Println(B) fmt.Println(KB) fmt.Println(MB) fmt.Println(GB)}
1
1024 1.048576e+06 1.073741824e+09本文共 266 字,大约阅读时间需要 1 分钟。
package mainimport ( "fmt")const ( B float64 = 1 << (iota * 10) KB MB GB)func main() { fmt.Println(B) fmt.Println(KB) fmt.Println(MB) fmt.Println(GB)}
1
1024 1.048576e+06 1.073741824e+09转载于:https://www.cnblogs.com/Erick-L/p/7763918.html