Question about double type

Double is 4 bytes so does that mean the largest number I can have is 2 ^ 32.

Double what?
with 4 bytes, a long integer, the biggest number is +/- 2^31 (Ok one more on the negative side)

LIke if I say,

int x
double y
long z
float t

Which variable can store the biggest number?

Which variable can store the biggest number?

float

OK float thank you how big? Max(float Number is =?)

Also what is next biggest? Long like you just said?

NVM

Long = 2,147,483,647
Float = 3.4028235E+38

Section: "Data types"

Floating-point numbers can be as large as 3.4028235E+38 and as low as -3.4028235E+38. They are stored as 32 bits (4 bytes) of information.

Double precision floating point number. Occupies 4 bytes.
The double implementation on the Arduino is currently exactly the same as the float, with no gain in precision.

Unsigned long variables are extended size variables for number storage, and store 32 bits (4 bytes). Unlike standard longs unsigned longs won't store negative numbers, making their range from 0 to 4,294,967,295 (2^32 - 1).

Long variables are extended size variables for number storage, and store 32 bits (4 bytes), from -2,147,483,648 to 2,147,483,647.

Integers are your primary datatype for number storage, and store a 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).

Look under the reference in your arduino help menu for more information.

budder8818:
Long = 2,147,483,647

Don't forget that 1 bit is used for sign. If you don't care about sign, that makes integer types twice as big.

http://arduino.cc/en/Reference/UnsignedLong

No, one bit is not used as sign bit.
The representation is 2's complement.

Don't forget 'long long'

While this is 2's complement if the most significant bit is a one then it is a negative number so in layman's terms it can be thought of a bit that indicates the sign. True it is not a sign an magnitude representation that has bit patterns for +0 and -0 which I always thought quite surreal.

Could make solving the value of i(j for the sparkies) easier, though
]:smiley:

Surreal and imaginary I get it. :slight_smile: