Power (operator)

is a primitive dyadic operator that performs bounded looping, unbounded looping, and function inverses in NARS2000, Dyalog APL, and related implementations like ngn/apl, dzaima/APL, and Extended Dyalog APL.

Description
A call to Power is of the form, where
 * is an optional argument.
 * is a function. If  is given, then it is bound to    so   is equivalent to.
 * can be an array or a function.

Power repeatedly applies  to   based on the type of operand  :
 * Function: Must be dyadic and must return a boolean singleton. The previous iteration value is provided as left argument to, and the current iteration value is given as right argument.   is repeatedly applied until this function returns 1.
 * Integer: Applies    times to  . If   is negative, then the inverse of   (if available) is applied.
 * Integer Array: In Extended Dyalog APL,  can be an integer array. Each integer   in   will be replaced by.

Examples
Some basic examples: A well-known use for Power is iterating until a fixed point is reached. Power is also used to access function inverses.

Lessons

 * APL Cultivation: 3, 34, 35, 49

Documentation

 * Dyalog
 * J Dictionary, NuVoc