SCALAR TYPES

Boolean

bool a = true;
bool b = 0;
bool c = bool(1.0);

A scalar type that can hold the logical values of either true or false. The values are represented by the constant integer values 1 and 0. Implicit and explicit type conversions are supported.

Character

char a = 42;
char b = 3.1415;
char c = char(true);

A signed integer scalar type with a length of 8 bit. Implicit and explicit type conversions are supported.

Unsigned character

uchar a = 42;
uchar b = 3.1415;
uchar c = uchar(true);

An unsigned integer scalar type with a length of 8 bit. Implicit and explicit type conversions are supported.

Short

short a = 42;
short b = 3.1415;
short c = short(true);

A signed integer scalar type with a length of 16 bit. Implicit and explicit type conversions are supported.

Unsigned short

ushort a = 42;
ushort b = 3.1415;
ushort c = ushort(true);

An unsigned integer scalar type with a length of 16 bit. Implicit and explicit type conversions are supported.

Integer

int a = 42;
int b = 3.1415;
int d = int(true);

A signed integer scalar type with a length of 32 bit. Implicit and explicit type conversions are supported.

Unsigned integer

uint a = 42;
uint b = 3.1415;
uint c = uint(true);

An unsigned integer scalar type with a length of 32 bit. Implicit and explicit type conversions are supported.

Long

long a = 42;
long b = 3.1415;
long d = long(true);

A signed integer scalar type with a length of 64 bit. Implicit and explicit type conversions are supported.

Unsigned long

ulong a = 42;
ulong b = 3.1415;
ulong c = ulong(true);

An unsigned integer scalar type with a length of 64 bit. Implicit and explicit type conversions are supported.

Size of

size_t s = sizeof(aFloat4);

An unsigned integer scalar type with a length of 64 bit that is the return value of the sizeof operator. Implicit and explicit type conversions are supported.

Pointer difference

ptrdiff_t d = p1 - p0;

A signed integer scalar type with a length of 64 bit that is the result of substracting one pointer from another.

Half precision floating point scalar

half a = 1.0;
half b = true;
half c = half(1);

A half precision floating point scalar type. Implicit and explicit type conversions are supported.

Floating point scalar

float a = 1.0;
float b = true;
float c = float(1);

A single precision floating point scalar type. Implicit and explicit type conversions are supported.

Void

void func();

A data type that does not represent a value.