caret INDEX

^ _ _ _ CARET _ _ _ _ _ _ _ _ _ _ _ _ operator

The ^ operator is a prefix or infix binary exponentiation operator. It is equivalent to power or **.

syntax:

<expression> ^<expression> or ^(<expression>,<expression>)

<expression> may be any valid REDUCE expression.

examples:


x^15; 

   15
  X   


x^y^z; 

   Y*Z
  X    


x^(y^z); 

    Z
   Y
  X   


^(y,4); 

   4
  Y  


on rounded; 

2^pi; 

  8.82497782708

The exponentiation operator is left associative, so that a^b^c is equivalent to (a^b)^c, as shown in the second example. Note that this is <not> a^(b^c), which would be right associative.

When nat is on (the default), REDUCE output produces raised exponents, as shown.

A square matrix may also be raised to positive and negative powers with the exponentiation operator (negative powers require the matrix to be invertible). Scalar expressions and equations may be raised to fractional and floating-point powers.