Primitive Data Types
The Rux compiler recognize such primitive data types.
Signed integer types
| Type | Size | Minimum Value | Maximum Value |
|---|---|---|---|
int8 | 1 byte | −27 = −128 | 27−1 = 127 |
int16 | 2 bytes | −215 = −32,768 | 215−1 = 32,767 |
int32 | 4 bytes | −231 = −2,147,483,648 | 231−1 = 2,147,483,647 |
int64 | 8 bytes | −263 ≈ −9.223372 × 1018 | 263−1 ≈ 9.223372 × 1018 |
int128 | 16 bytes | −2127 ≈ −1.7014118 × 1038 | 2127−1 ≈ 1.7014118 × 1038 |
int256 | 32 bytes | −2255 ≈ −5.7896045 × 1076 | 2255−1 ≈ 5.7896045 × 1076 |
int512 | 64 bytes | −2511 ≈ −6.2771017 × 10153 | 2511−1 ≈ 6.2771017 × 10153 |
Unsigned integer types
| Type | Size | Minimum Value | Maximum Value |
|---|---|---|---|
uint8 | 1 byte | 0 | 28−1 = 255 |
uint16 | 2 bytes | 0 | 216−1 = 65,535 |
uint32 | 4 bytes | 0 | 232−1 = 4,294,967,295 |
uint64 | 8 bytes | 0 | 264−1 ≈ 1.8446744 × 1019 |
uint128 | 16 bytes | 0 | 2128−1 ≈ 3.4028237 × 1038 |
uint256 | 32 bytes | 0 | 2256−1 ≈ 1.1579209 × 1077 |
uint512 | 64 bytes | 0 | 2512−1 ≈ 1.3407808 × 10154 |
Floating-point types
| Type | Size | Approximate Range | Significant Digits |
|---|---|---|---|
float8 | 1 byte | ±1.0 × 10-2 to ±2.5 × 101 | ~1 digit |
float16 | 2 bytes | ±6.1 × 10-5 to ±6.5 × 104 | ~3 digits |
float32 | 4 bytes | ±1.2 × 10-38 to ±3.4 × 1038 | ~7 digits |
float64 | 8 bytes | ±2.2 × 10-308 to ±1.8 × 10308 | ~15–16 digits |
float128 | 16 bytes | ±3.4 × 10-617 to ±1.2 × 10617 | ~34 digits |
float256 | 32 bytes | ±1.0 × 10-1985 to ±1.0 × 101985 | ~72 digits |
float512 | 64 bytes | ±1.0 × 10-5950 to ±1.0 × 105950 | ~154 digits |
Boolean types
| Type | Size | Range |
|---|---|---|
bool8 | 1 byte | false or true |
bool16 | 2 bytes | false or true |
bool32 | 4 bytes | false or true |
bool64 | 8 bytes | false or true |
bool128 | 16 bytes | false or true |
bool256 | 32 bytes | false or true |
bool512 | 64 bytes | false or true |
false is equal to 0, true is equal to 1
Character types
| Type | Size | Range |
|---|---|---|
char8 | 1 byte | 0 to 0xFF |
char16 | 2 bytes | 0 to 0xFFFF |
char32 | 4 bytes | 0 to 0xFFFFFFFF |
char64 | 8 bytes | 0 to 0xFFFFFFFFFFFFFFFF |
char128 | 16 bytes | 0 to 0xFFFFFFFFFFFFFFFF... (32 total) |
char256 | 32 bytes | 0 to 0xFFFFFFFFFFFFFFFF... (64 total) |
char512 | 64 bytes | 0 to 0xFFFFFFFFFFFFFFFF... (128 total) |