Table 2.14. operators
| type | description | example |
|---|---|---|
| && | logical AND | |
| || | logical OR | |
| ! | not | !1; return 0 |
| + | add | 3 + 2; return 5 |
| - | substract | 3 - 2; return 1 |
| = | affectation of value | a = 5; var 'a' as the value 5 |
| -- | decrement by 1 | a = 5; a--; a is 4 |
| ++ | increment by 1 | a = 5; a++; a is 6 |
| += | increment by value | a = 5; a += 6; a is 11, equivalent to a = a + value; |
| -= | decrement by value | a = 5; a -= 6; a is -1, equivalent to a = a - value |
| * | multiply | 3 * 2; return 6 |
| / | divide | 3 / 2; return 1.5 |
| ** | power, equivalent to math: ^ | 3**4; return 81, 3*3*3*3 |
| % | modulo, return the entire part of divide | 15 % 4; return 3 |
| ~= | Difference between operands is ≤ system.epsilontilde (defaults to 0.0001) | |
| sgn() | sgn(value); give sign of value; return 1 if positive, -1 if negative | sgn(-4); sgn(5); |