Rox supports the following numeric types:
integeris an unsized integer. An unsized integer can be arbitrarily large, but it cannot be written directly to an output. However, the conversion from unsized integers to sized integers is automatic.
unsigned(n)is an unsigned number of size
n≥0. Addition of unsigned numbers is wrapping addition, that is, only the least-significant
nbits of the answer are retained.
signed(n)is a signed number of size
rationalis a rational number with arbitrarily large numerator and denominator.
floatis a floating-point number that can be used in internal expressions.
float cannot be used as inputs or outputs. Currently
there is very little you can do with them. Eventually, they will be
usable to generate constant lookup tables in Rox without needing
Relational expressions in Rox produce a value of type
bit value can be either
It is easy to create type aliases in Rox. This statement
u6 = unsigned(6);
creates an alias of the
unsigned(6) type. The identifier
u6 can be
used anywhere the
unsigned(6) type specifier can be used. Rox
provides a type alias of its own;
bit is an alias for
false and true are constants of type
bit with values 0 and 1
More comlex types
Eventually, Rox will also support arrays, structure types, and enumerated types, but they have not been implemented yet.