Skip to content

Numeric

There are 3 numeric types in NC: int, uint, and float.

The int type is a 64-bit signed integer type.

You can declare ints by simply writing a number without a decimal point.

int my_num = 1;

The uint type is a 64-bit unsigned integer. A uint can be declared similarly to an int:

uint my_num = 1; // cannot be negative
uint my_num = 1u; // can also use the `u` suffix

Hexadecimal numbers need to be prefixed with 0x, for example, 0xFF. The part after the 0x is case-insensitive.

Octal numbers need to be prefixed with 0o, for example, 0o777.

The float type is a 64-bit floating point number, following the IEEE 754 standard. It can be declared by writing a number with a decimal point.

float my_float = 1.0;