Operators
Operator | Name | Syntax | Example | Result |
---|---|---|---|---|
+ |
Add | AB + XY |
4 + 5 |
9 |
- |
Subtract | AB - XY |
7 - 3 |
4 |
* |
Multiply | AB * XY |
2 * 3 |
6 |
/ |
Divide | AB / XY |
6 / 2 |
3 |
%, mod |
Modulus | AB % XY |
8 % 3 |
2 |
^ |
Power | AB ^ XY |
2 ^ 3 |
8 |
! |
Factorial | XY! |
5! |
120 |
& |
Bitwise And | AB & XY |
5 & 3 |
1 |
~ |
Bitwise Not | ~AB |
~2 |
-3 |
⎮ |
Bitwise Or | AB ⎮ XY |
5 ⎮ 3 |
7 |
^⎮ |
Bitwise Xor | AB ^⎮ XY |
5 ^⎮ 2 |
6 |
? : |
Conditional Expression | AB ? XY : PQ |
15 > 100 ? 1 : -1 |
-1 |
Table from the math.js documentation, filtered to the subset Guesstimate supports.