Golang的常用常量

Golang的常用常量

更多的内容可以查看golang 源码

Package math - The Go Programming Language (google.cn)

const (
    MaxInt    = 1<<(intSize-1) - 1
    MinInt    = -1 << (intSize - 1)
    MaxInt8   = 1<<7 - 1
    MinInt8   = -1 << 7
    MaxInt16  = 1<<15 - 1
    MinInt16  = -1 << 15
    MaxInt32  = 1<<31 - 1
    MinInt32  = -1 << 31
    MaxInt64  = 1<<63 - 1
    MinInt64  = -1 << 63
    MaxUint   = 1<<intSize - 1
    MaxUint8  = 1<<8 - 1
    MaxUint16 = 1<<16 - 1
    MaxUint32 = 1<<32 - 1
    MaxUint64 = 1<<64 - 1
)

  

 

posted @ 2022-04-21 16:04  SoutherLea  阅读(59)  评论(0编辑  收藏  举报