之前沒有在意這個問題,所以稍微整理一下:)
數據類型 | 字節大小 | 數值範圍 |
---|---|---|
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) |