Course of Raku / Advanced / Operators / Review of operator behaviour / Exercises / Power tower
Solution: Power tower
Here is a possible solution to the task.
Code
say 2 ** 2 ** 3;🦋 You can find the source code in the file power-tower.raku.
Output
256Comments
Because
**is right-associative, the expression groups as2 ** (2 ** 3).That is
2 ** 8, which is256— not(2 ** 2) ** 3, which would be64.