List of data types
From FIRSTwiki
There are several basic data types, listed below:
[edit]
Numeric
Numeric data types come in 2 variaties: Integral and Floating-point. You can specify either by using the signed and unsigned keywords.
[edit]
Integers
Can only contain integers. They are signed by default.
- char - 1 byte (8 bits) long, range: 0 - 255 unsigned (-128 - 127 signed)
- int - 2 bytes (16 bits), 0 - 65,535 (-32,768 - 32,767)
- short - same as int
- short long - 3 bytes (24 bits), 0 - 16,777,215 (-8,388,608 - 8,388,607)
- long - 4 bytes (32 bits), 0 - 4,294,967,295 (-2,147,483,648 - 2,147,483,6)
[edit]
Decimals
Also known as Floating-point, they can contain fractional numbers. They are stored in scientific notation.
[citation needed]
Note: the processor in the controllers does not have a floating point unit. Using floating-point can bog it down.
- float - 4 bytes (32 bits)
- Exponent range: -126 - 128
- Overall range:
(and 0)
- double - same as float

