Parentheses for grouping.

This commit is contained in:
Bob Nystrom
2013-10-31 21:49:15 -07:00
parent 8e6ce2bb2a
commit 46c0fe87e6
2 changed files with 17 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
// * has higher precedence than +.
io.write(2 + 3 * 4) // expect: 14
// * has higher precedence than -.
io.write(20 - 3 * 4) // expect: 8
// Using () for grouping.
io.write((2 * (6 - (2 + 2)))) // expect: 4