Go语言编程快速入门:整数
P8 go07 - 整数
Go提供了10种整数类型
- 不可以存小数的
- 范围有限
- 通常根据数值范围来选取整数类型
5种整数是有符号的(int)
- 能表示正数
- 0
- 负数
5种是无符号的(uint)
- 能表示正数
- 0

init/unit:
这两种是根据不同的设备来优化的
颜色
var red, green, blue uint8 = 0,141,213;

整数环绕

为什么会发生环绕

如何避免时间发生环绕

这两种是根据不同的设备来优化的
var red, green, blue uint8 = 0,141,213;