Exponentiation with infix operators in (or operating on) the base: Difference between revisions

added langur language example
m (→‎{{header|Raku}}: use Unicode '∧' in place of ASCII '^', to avoid warning)
(added langur language example)
Line 448:
1
</pre>
 
=={{header|Julia}}==
In Julia, the ^ symbol is the power infix operator. The ^ operator has a higher precedence than the - operator,
Line 462 ⟶ 463:
x is 5, p is 2, -x^p is -25, -(x)^p is -25, (-x)^p is 25, -(x^p) is -25
x is 5, p is 3, -x^p is-125, -(x)^p is -125, (-x)^p is -125, -(x^p) is -125
</pre>
 
=={{header|langur}}==
<syntaxhighlight lang="langur">writeln [-5^2, -(5)^2, (-5)^2, -(5^2)]
writeln [-5^3, -(5)^3, (-5)^3, -(5^3)]
</syntaxhighlight>
 
{{out}}
As of 0.12, this is the output.
<pre>[-25, -25, 25, -25]
[-125, -125, -125, -125]
</pre>
 
Prior to 0.12, this is the output.
<pre>[25, 25, 25, -25]
[-125, -125, -125, -125]
</pre>
 
885

edits