Integer Storage

Status
Not open for further replies.

FredA

Active member
If I store a negative number in a variable that is int8_t, or int16_t or int32_t and then print it in binary, it is always 32 bits long. Does a T3.6 store all of these as 32 bits?

And what is the endianness?
 
If I store a negative number in a variable that is int8_t, or int16_t or int32_t and then print it in binary, it is always 32 bits long. Does a T3.6 store all of these as 32 bits?

And what is the endianness?
No, but the C default conversion rules state that char, short, and variants always get converted to int or unsigned int. C++ inherits these rules. Given that the Print.h include file defines rules for uint_t, int, etc. and not int_t, int16_t, short, or signed char, you are seeing the default conversion to int.
 
Status
Not open for further replies.
Back
Top