File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1344,8 +1344,19 @@ but exists for completeness' sake. The following operators are supported:
13441344 ``{{ '=' * 80 }} `` would print a bar of 80 equal signs.
13451345
13461346``** ``
1347- Raise the left operand to the power of the right operand. ``{{ 2**3 }} ``
1348- would return ``8 ``.
1347+ Raise the left operand to the power of the right operand.
1348+ ``{{ 2**3 }} `` would return ``8 ``.
1349+
1350+ Unlike Python, chained pow is evaluated left to right.
1351+ ``{{ 3**3**3 }} `` is evaluated as ``(3**3)**3 `` in Jinja, but would
1352+ be evaluated as ``3**(3**3) `` in Python. Use parentheses in Jinja
1353+ to be explicit about what order you want. It is usually preferable
1354+ to do extended math in Python and pass the results to ``render ``
1355+ rather than doing it in the template.
1356+
1357+ This behavior may be changed in the future to match Python, if it's
1358+ possible to introduce an upgrade path.
1359+
13491360
13501361Comparisons
13511362~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments