Integer datatypes
From Real Software Documentation
(Redirected from Integer)
Data Type
Real Studio has several intrinsic integer datatypes which differ by:
- Their ability to hold negative and positive values (signed integers), or positive only (unsigned integers). The name of unsigned integer types usually begins with the letter "U"
- The range of values they can hold, which is directly related to the number of bytes used for their storage (in memory or on disk). The storage size is traditionally expressed in bits instead of bytes (1 byte = 8 bits): 8-, 16-, 32- and 64-bits.
- The Integer type is an alias to the platform's native signed integer type. On 32-bit builds, this ends up being SInt32 and on 64-bit builds this ends up being SInt64.
The default value for every integer type is 0.
The following table summaries these data types.
| Data Type | Number of Bytes | Range |
|---|---|---|
| Int8 | 1 | -128 to 127 |
| Int16 | 2 | -32,768 to 32,767 |
| Int32 | 4 | -2,147,483,648 to 2,147,483,647 |
| Int64 | 8 | -2^63 to 2^63-1 |
| UInt8 or Byte | 1 | 0 to 255 |
| UInt16 | 2 | 0 to 65535 |
| UInt32 | 4 | 0 to 4,294,967,295 |
| UInt64 | 8 | 0 to 2^64-1 |
Example
The following declares an Int64.
See Also
Dim, Static, Declare statements; -, +, *, /, <, <=, =, >=, >, <> operators; Boolean, Byte, CFStringRef, Color, CString, Currency, Delegate, Double, Int16, Int32, Int64, Int8, Integer, OSType, PString, Ptr, Short, Single, String,
