📌  相关文章
📜  golang 数字的最大长度 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:45:01.583000             🧑  作者: Mango

代码示例1
package main

import (
    "fmt"
    "math"
)

func main() {
    // integer max
    fmt.Printf("max int64   = %+v\n", math.MaxInt64)
    fmt.Printf("max int32   = %+v\n", math.MaxInt32)
    fmt.Printf("max int16   = %+v\n", math.MaxInt16)

    // integer min
    fmt.Printf("min int64   = %+v\n", math.MinInt64)
    fmt.Printf("min int32   = %+v\n", math.MinInt32)

    fmt.Printf("max float64 = %+v\n", math.MaxFloat64)
    fmt.Printf("max float32 = %+v\n", math.MaxFloat32)

    // etc you can see more int the `math`package
}

/*
  max int64   = 9223372036854775807
  max int32   = 2147483647
  max int16   = 32767
  min int64   = -9223372036854775808
  min int32   = -2147483648
  max float64 = 1.7976931348623157e+308
  max float32 = 3.4028234663852886e+38
*/