Most programming languages have a built-in implementation of exponentiation for integers and reals only.



Task

Demonstrate how to implement matrix exponentiation as an operator.




 
Array a[2,2];                 {illustrate with a 2x2 matrix}
[a]:=[(2/3, 1/3, 4/5, 1/5)];
[a]^-1;                       {matrix inverse}
[a]^0;                        {identity matrix}
[a]^2;
[a]^3;
[a]^10;
 