Operators
Arithmetic, comparison, logic, and assignment.
Arithmetic operators work on numbers. For string building with +, see the Strings page.
Comparisons (<, <=, >, >=) require numbers. == and != work on any values.
and / or short-circuit. ! negates truthiness.
Arithmetic
Standard math on numbers. Division always returns a float.
print 10 + 3;
print 10 - 3;
print 10 * 3;
print 10 / 3;output
13 7 30 3.3333333333333335
Comparison & logic
Compare numbers, test equality, and combine conditions with `and` / `or`.
print 5 > 3;
print 5 == 5;
print !false;
print true and false;
print true or false;output
true true true false true
Operator reference
Quick lookup for every operator Rain supports.
| Symbol | Description |
|---|---|
+ - * / | Arithmetic on numbers (`+` also concatenates strings, see Strings) |
== != < <= > >= | Comparisons |
and or | Logical (short-circuit) |
! | Logical not |
= | Assignment |