Primitive types
The primitive types are always in scope. Arithmetic on int is checked:
overflow, division by zero and out-of-range shifts panic in every build.
float follows IEEE-754 and never panics. byte arithmetic wraps modulo 256
(the compiler warns, E0130). Convert between them with as; see
Casts.
Compound types (tuples, arrays, records, classes, enums, function types) are described in the type system page.
Built into the compiler.
Types#
| Name | Description |
|---|---|
int | A 64-bit signed integer, from -9223372036854775808 to 9223372036854775807. |
float | A 64-bit IEEE-754 floating-point number. |
bool | A boolean: true or false. |
byte | An unsigned 8-bit integer in 0..=255. |
string | A UTF-8 text string. |
unit | The type with a single value, (), used where there is no meaningful value. |