Operators
Unary Operators
| Operator |
Implementation |
not x == true |
 |
length x |
 |
round x |
 |
abs x |
 |
floor x |
 |
ceil x |
 |
sqrt x |
 |
sin x |
 |
cos x |
 |
tan x |
 |
asin x |
 |
acos x |
 |
atan x |
 |
ln x |
 |
log x |
 |
antiln x |
 |
antilog x |
 |
Binary Operators
| Operator |
Implementation |
x + y |
 |
x - y |
 |
x * y |
 |
x / y |
 |
x // y |
 |
x % y |
 |
x & y |
 |
x == y |
 |
x != y |
 |
x < y |
 |
x <= y |
 |
x > y |
 |
x >= y |
 |
x == true and y == true |
 |
x == true or y == true |
 |
x in y |
 |
x not in y |
 |
x[y] |
 |
Operator Precedence
Highest precedence first:
| Order |
Operators |
Grouping |
| 1 |
Calls f(...), indexing x[i], and field access x.field |
Left to right |
| 2 |
Unary operators, including -, not, and length |
Right to left |
| 3 |
*, /, //, % |
Left to right |
| 4 |
+, - |
Left to right |
| 5 |
<, <=, >, >= |
Left to right |
| 6 |
& |
Right to left |
| 7 |
in, not in, ==, != |
Left to right |
| 8 |
and |
Left to right |
| 9 |
or |
Left to right |
Reporters
pick random () to ()
random(x, y)
(pick random (x) to (y))
() contains ()
contains(string, substring)
<(string) contains (substring)?>