Data type
A data type is a classification of identifying the type of a value. Types commonly used in GTA includes integer, floating point, and string. The amount of data allowed to be stored is limited by the type and size of the data. The size of the data listed on this page is in bytes. For integers there are two ways to represent the data, signed and unsigned, whereas floating point values are always signed. A signed data range includes negative numbers while unsigned do not include negatives. The following list will show the most commonly used types and sizes of data.
Integer
An integer is a number without a decimal or fractional component.
| Size (bytes) |
Range | |||||
|---|---|---|---|---|---|---|
| Signed | Name | Unsigned | Name | |||
| 1 | -128 to 127 | INT8, CHAR | 0 to 255 | UINT8, BYTE | ||
| 2 | -32,768 to 32,767 | INT16, SHORT | 0 to 65,535 | UINT16, WORD, USHORT | ||
| 4 | -2,147,483,648 to 2,147,483,647 | INT32, LONG | 0 to 4,294,967,295 | UINT32, DWORD, ULONG | ||
Floating-point
A floating point is a number with a decimal component and can store extremely large or small numbers while sacrificing significant digits. This is achieved by internally using exponents in scientific notation.
| Size (bytes) |
Range | Name |
|---|---|---|
| 4 | ±1.1754944×10-38 to ±3.4028234×1038 | SINGLE, FLOAT |
String
A string is a sequence of characters not treated as numbers.
-
GTAForums: Lengths of strings for coding in San Andreas