Qdr /

Parentheses

Qdr.ParenthesesGuide History

Hide minor edits - Show changes to output

Changed line 6 from:
Parentheses are used to specify the order of the computation.
to:
'''Parentheses''' are used to specify the order of the computation.
Added lines 1-10:
(:title Parentheses:)
(:category: Guide :)
(:Summary: Change evaluation order. :)


Parentheses are used to specify the order of the computation.

As said, the @@d@@ [[Qdr/OperatorsGuide|operator]] is computed before of the @@*@@ operator, and the latter is computed before of the @@+@@ operator. So, the formula "@@2d6*3+4@@" means ''roll two six sided dice, add the result together, multiply it by 3 and then add 4''.

Using parentheses it is possible to modify that order: whatever is put between them is computed before of the operators outside them. I.e. the formula "@@2d(6*(3+4))@@" means ''add together 3 and 4, multiply the result by 6 and then roll two dice with a number of faces equal to the result''. Or, in other words, ''roll two [[http://en.wikipedia.org/wiki/42_(number) | 42]] sided dice and add the result together''.
Page last modified on September 09, 2015, at 07:24 PM