Binary operation node — the arithmetic backbone of an expression.
Operator
Meaning
Precedence
Associativity
+-
add, subtract
10
left
*/%
multiply, divide, modulo
20
left
**
power (also spelled ^)
30
right
Dice bind tighter than all of them (40), and postfix modifiers sit at 35,
so 2d6+3 is (2d6)+3 and 4d6kh3*2 is (4d6kh3)*2. The vs operator
binds loosest of all (2) and has its own VersusNode.
/ and % throw DIVISION_BY_ZERO / MODULO_BY_ZERO on a zero right
side; any operator producing a non-finite total throws NON_FINITE_RESULT.
Division is not rounded — wrap it in floor() if you need an integer.
Binary operation node — the arithmetic backbone of an expression.
+-*/%**^)Dice bind tighter than all of them (40), and postfix modifiers sit at 35, so
2d6+3is(2d6)+3and4d6kh3*2is(4d6kh3)*2. Thevsoperator binds loosest of all (2) and has its own VersusNode./and%throwDIVISION_BY_ZERO/MODULO_BY_ZEROon a zero right side; any operator producing a non-finite total throwsNON_FINITE_RESULT. Division is not rounded — wrap it infloor()if you need an integer.