Primitive types
Core provides numeric types, a Unicode scalar char, booleans and void.
Integer types
| Type | Signed | Width |
|---|---|---|
byte | No | 8-bit |
sbyte | Yes | 8-bit |
short | Yes | 16-bit |
ushort | No | 16-bit |
int | Yes | 32-bit |
uint | No | 32-bit |
long | Yes | 64-bit |
ulong | No | 64-bit |
Unicode characters
Xenon char represents exactly one Unicode scalar value and always occupies 4 bytes. Valid values are U+0000 through U+D7FF and U+E000 through U+10FFFF; UTF-16 surrogate values are excluded. Its default value is U+0000.
char latin = 'A';
char cyrillic = 'Ж';
char emoji = '😀';
char is distinct from every integer type. It is not a byte, a UTF-8 byte, a UTF-16 code unit or a grapheme cluster. A combining sequence such as e plus a combining acute accent contains two scalars and therefore cannot be one char.
Equality and ordering compare scalar values. Arithmetic is not defined for char; integer interoperation requires an explicit cast.
Target-sized integers
nint and nuint match the target pointer width. They are useful for native addresses, allocation sizes and offsets.
clong and culong match the selected platform's C ABI definition of long and unsigned long.
nuint size = 4096;
clong nativeResult = 0;
Floating-point and boolean types
float is IEEE-754 binary32 and double is IEEE-754 binary64. Conditions use the dedicated bool type and the values true and false.
float speed = 5.0f;
double elapsed = 10.5;
bool running = true;
void describes a function with no return value and also forms the untyped pointer void*.