32位單片機中各數據類型的數值範圍

之前沒有在意這個問題,所以稍微整理一下:)

數據類型 字節大小 數值範圍
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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章