Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Binary Operaters

Binary operators can create expressions that take two other expressions as input. An example of a binary operator is the add + operator:

main || {
    out((1 + 2)); // prints 3
}

Currently, all binary operator expressions must be wrapped in parentheses to denote the order of evaluation. Operator precedence will be added in the future, allowing for parentheses to be omitted to utilize a more typical default order of operations.

All the currently existing binary operators and the types they evaluate to:

Left TypeOperatorRight Type= Evaluated Type
uint+ (add)uintuint
int+ (add)intint
num+ (add)numnum
int- (subtract)intint
num- (subtract)numnum
uint* (multiply)uintuint
int* (multiply)intint
num* (multiply)numnum
num/ (divide)numnum
num% (mod)numnum
any== (equal to)anybool
any!= (not equal to)anybool
any> (greater than)anybool
any< (less than)anybool
any>= (greater than or equal to)anybool
any<= (less than or equal to)anybool
bool&& (and)boolbool
bool|| (or)boolbool
val~ (join)valval