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

Content deleted Content added
Add Python
Petelomax (talk | contribs)
Line 137:
</pre>
 
 
=={{header|Phix}}==
Phix has a power() function instead of an infix operator, hence there are only two possible syntaxes, with the obvious outcomes:
<lang Phix>for x=-5 to 5 by 10 do
for p=2 to 3 do
printf(1,"x = %2d, p = %d, power(-x,p) = %4d, -power(x,p) = %4d\n",{x,p,power(-x,p),-power(x,p)})
end for
end for</lang>
{{out}}
<pre>
x = -5, p = 2, power(-x,p) = 25, -power(x,p) = -25
x = -5, p = 3, power(-x,p) = 125, -power(x,p) = 125
x = 5, p = 2, power(-x,p) = 25, -power(x,p) = -25
x = 5, p = 3, power(-x,p) = -125, -power(x,p) = -125
</pre>
 
=={{header|Raku}}==