- This topic has 2 replies, 3 voices, and was last updated 7 years, 7 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › Arduino › Is that integer size would be differ for every 16bit, 32bit controller??
Is that integer size would be differ for every 16bit, 32bit controller?
Int x;
Is that now x will occupy different size in 16 bit,32 bit ??
Then what about the short int, long int,double, — All vary on architecture of controller ??
If we need to perform some 32 bit operations in 16 bit controller, how to do ??
i think int take a single word size of the controller(if 8 bit — 8, 16 bit — 16 bit),
I am so confused. kindly answer me with clear data(if possible example)
Thanks in Advance
Gokul
Hi,
Integers are your primary data-type for number storage.
On the Arduino Uno (and other ATMega based boards) an int stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) – 1).
On the Arduino Due and SAMD based boards, an int stores a 32-bit (4-byte) value. This yields a range of -2,147,483,648 to 2,147,483,647 (minimum value of -2^31 and a maximum value of (2^31) – 1).
it depends upon which cross compiler tool you are using
in normal C language int means 2 byte of memory
in all the controllers int type variable has 16 bit only