n^m ( n m -- n )


Vocabulary
math.matrices.extras

Inputs
nan object
ma matrix


Outputs
nan object


Word description
Because it is nonsensical to raise a number to the power of a matrix, this word exists to save typing swap m^n. See m^n for more information.

Errors
negative-power-matrix if n is a negative number other than -1.

undefined-inverse if n is -1 and the multiplicative-inverse of m is undefined.

Notes
This word is the swapped variant of m^n.
This word is intended for use with "flat" (2-dimensional) matrices.
This word assumes that elements of the input matrix are compatible with the following words:
max ( obj1 obj2 -- obj )

abs ( x -- y )

/ ( x y -- z )


Examples
USING: math.matrices.extras prettyprint ; 2 { { 1 2 } { 3 4 } } n^m .
{ { 7 10 } { 15 22 } }


Definition