Numeric Operations

All the numeric types (i.e., core.Byte, core.Int, core.Nat, core.Long, core.Word, core.Float, and core.Double) provide the standard arithmetic operators (i.e., +, -, *, /). All operators can be combined with = to form += and so on. Integer types additionally provide prefix and postfix operators for increment and decrement (i.e. x++ and ++x). The unsigned types also provide bitwise operators (i.e. &, |, ^, ~).

It is possible to convert between the types using member functions in the standard types. For example, converting an integer to a float can be done as follows:

Int x = 10;
Float y = x.float;

The system also provides the following operations in addition to regular operators:

Finally, the types provides the following static operations:

Note: Floating point types use min and max to represent the largest and smallest positive value that can be represented (i.e. min returns a positive but very small number). Floating point types also provide infinity to get the positive infinity value, as well as ceil and floor to round up and down respectively.

Complex numbers

The system also provides the class core.Complex, which represents complex numbers (using core.Float). It behaves much like built-in numeric types, and has the following members: