`Description`

`Description`

```
```*Power* is generalized exponentiation: it raises the value *x* to the power *n*, where *n* is a non-negative integer.

The first version of *power* returns *x* raised to the *n*th power; that is, it returns *x * x … * x* , where *x* is repeated *n* times. [1] If *n == 0*, then it returns *identity_element(multiplies*()) .

The second version of *power* is just like the first except that it uses an arbitrary Monoid Operation instead of *multiplies*, returning *identity_element(op)* when *n == 0*.

**Important note**: *power* does not assume that multiplication is commutative, but it does rely crucially on the fact that multiplication is associative. If you have defined *** or *MonoidOperation* to be a non-associative operation, then *powerwill give you the wrong answer*. [2]

Loading...