Primitive types

Core provides fixed-width numeric types, target-sized integers, C-compatible long integers, booleans and void.

Integer types

TypeSignedWidth
byteNo8-bit
sbyteYes8-bit
shortYes16-bit
ushortNo16-bit
intYes32-bit
uintNo32-bit
longYes64-bit
ulongNo64-bit

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*.