Exponentiation with infix operators in (or operating on) the base: Difference between revisions
Exponentiation with infix operators in (or operating on) the base (view source)
Revision as of 14:11, 3 November 2020
, 3 years agoUndo revision 315342 by Thundergnat (talk) meh, not necessary
Thundergnat (talk | contribs) m (→{{header|Raku}}: add explanatory exposition) |
Thundergnat (talk | contribs) (Undo revision 315342 by Thundergnat (talk) meh, not necessary) |
||
Line 106:
say "\nEasily modified: custom loose infix exponentiation is looser (lower) precedence than unary negation.";
-> $x, $p { infix-loose-exp($x, $p) } for -5, 2, -5, 3, 5, 2, 5, 3;</lang>
{{out}}
<pre>Default precedence: infix exponentiation is tighter (higher) precedence than unary negation.
Line 121 ⟶ 118:
x = -5 p = 3 │ -x↑p = 125 │ -(x)↑p = 125 │ (-x)↑p = 125 │ -(x↑p) = 125
x = 5 p = 2 │ -x↑p = 25 │ -(x)↑p = 25 │ (-x)↑p = 25 │ -(x↑p) = -25
x = 5 p = 3 │ -x↑p = -125 │ -(x)↑p = -125 │ (-x)↑p = -125 │ -(x↑p) = -125</pre>
=={{header|REXX}}==
|