之前没有在意这个问题,所以稍微整理一下:)
数据类型 | 字节大小 | 数值范围 |
---|---|---|
char | 1 Byte | (-2^7, 2^7 - 1) |
uchar | 1 Byte | (0,2^8 - 1) |
short | 2 Byte | (-2^15, 2^15 - 1) |
ushort | 2 Byte | (0, 2^16 - 1) |
int | 4 Byte | (-2^31, 2^31 - 1) |
uint | 4 Byte | (0, 2^32 - 1) |
long | 4 Byte | (-2^31, 2^31 - 1) |
ulong | 4 Byte | (0, 2^32 - 1) |
float | 4 Byte | (-2^31, 2^31 - 1) |
double | 8 Byte | (-2^63, 2^63 - 1) |
long long | 8 Byte | (-2^63, 2^63 - 1) |