Course of Raku / Advanced / Operators / Review of operator behaviour

Quiz — Precedence

What does the following program print?

say 2 * 3 ** 2;
118
036
012
081

** has higher precedence than *, so the exponentiation happens first: 3 ** 2 is 9, and then 2 * 9 is 18. Reading it left to right as (2 * 3) ** 2 would give the wrong answer, 36.

Course navigation

Solution: Chained comparison   |   Meta-operators