Primitive Types¶
Overview¶
Primitive types are the fundamental types in Larol's type system.
Syntax¶
Rules¶
Boolean Type¶
The bool type MUST have an 8-bit representation. A bool value MUST contain only 0 or 1. Any operation that would produce a bool value outside this range MUST normalize it: zero MUST become 0, non-zero MUST become 1.
Integer Types¶
Integer types MUST have the following bit-widths and signedness variants:
| Name | Width | Signed | Unsigned |
|---|---|---|---|
char | 8-bit | char | uchar |
short | 16-bit | short | ushort |
int | 32-bit | int | uint |
long | 64-bit | long | ulong |
Floating-Point Types¶
Floating-point types MUST have the following bit-widths:
| Name | Description | Width |
|---|---|---|
half | Half precision | 16-bit |
float | Single precision | 32-bit |
double | Double precision | 64-bit |