Exponentiation operator: Difference between revisions
add RPL - zero power case for matrice
m (add RPL) |
(add RPL - zero power case for matrice) |
||
Line 3,089:
=={{header|RPL}}==
RPL can not overload operators, but does often handle many data types - including unsigned integers and floating-point numbers - with same methods, which makes code compact and versatile. The one-line program below can exponentiate real and complex numbers, but also matrices.
≪ '''IF''' DUP NOT '''THEN''' DROP DUP TYPE 3 == SWAP IDN 1 IFTE '''ELSE''' 1 1 ROT '''START''' OVER * '''
25.2 3 '''POWER'''
Line 3,102:
3: -15625
2: (-142,-65)
1: [[
</pre>
|