Operators
Complete reference for all operators in Quartz.
Arithmetic Operators
| Operator |
Description |
Example |
Result |
+ | Addition | 5 + 3 | 8 |
- | Subtraction | 5 - 3 | 2 |
* | Multiplication | 5 * 3 | 15 |
/ | Division | 15 / 3 | 5 |
% | Modulo | 7 % 3 | 1 |
Comparison Operators
| Operator |
Description |
Example |
== | Equal to | a == b |
!= | Not equal to | a != b |
< | Less than | a < b |
> | Greater than | a > b |
<= | Less than or equal | a <= b |
>= | Greater than or equal | a >= b |
Logical Operators
| Operator |
Description |
Example |
&& | Logical AND | a && b |
|| | Logical OR | a || b |
! | Logical NOT | !a |
Assignment Operators
| Operator |
Description |
Example |
= | Assignment | x = 5 |
+= | Add and assign | x += 5 |
-= | Subtract and assign | x -= 5 |
*= | Multiply and assign | x *= 5 |
/= | Divide and assign | x /= 5 |
Operator Precedence
From highest to lowest:
! (unary NOT)
* / %
+ -
< > <= >=
== !=
&&
||
= += -= *= /=