stm32 common data types

The byte length of the data type of stm32

insert image description here
s8 occupies 1 byte, data range -2^7 to (2^7-1)
s16 occupies 2 bytes, data range -2^15 to (2^15-1)
s32 occupies 4 bytes, data range -2 ^31 to (231-1)231 = 2147483647
int64_t occupies 8 bytes, data range -2^63 to (2^63-1) 2^63 = 9223372036854775807ll
2. Unsigned integer
u8 occupies 1 byte, data range 0 - 2^8
u16 occupies 2 bytes, data range 0 - 2^16
u32 occupies 4 bytes, data range 0 - 2^32 2^32 = 4294967295
uint64_t occupies 8 bytes, data range 0 - 2^64 2 ^64 = 18446744073709551615
3. Floating point type
float —— 4 bytes, signed type, which can express negative numbers/decimal numbers; Float type must be able to accurately represent at least 6 digits after the decimal point.
double——8 bytes, 64bit, signed type, which can express negative numbers/decimal numbers; the Double type must be accurate to at least 10 decimal places.

Variable type renamed with typedef

insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/weixin_44057803/article/details/132071389