Skip to main content

* — Exponential / Exponent

Function. Hanzi: 幂 (冪). Ranks: 0 monadic, 0 0 dyadic

*Y: eY. Pervasive.

*0                ⍝ 1

X*Y: XY. Whole powers of integers give integers, and whole powers of rationals (ᵣ) give rationals. An integer with a negative exponent floors, as integer ÷ does:

2ₓ*3ₓ             ⍝ 8ₓ
2ₓ*¯3ₓ            ⍝ 0ₓ
¯2ₓ*¯3ₓ           ⍝ ¯1ₓ
2ᵣ*¯3ₓ            ⍝ 1ᵣ8

This holds in both modes and at every width. Base 1ₓ gives 1ₓ, base ¯1ₓ gives 1ₓ or ¯1ₓ as the exponent is even or odd, and base 0ₓ gives the largest integer: i64’s under dynamic kinds, where integers widen, and the width’s own for fixed widths and under static kinds.

Other powers use principal complex branches where needed.

¯1*0.5            ⍝ 0j1

See also function power ⍣.

Inverse

*⁻ is ⍟. With the right argument fixed, (*↢X)⁻Y is Y*÷X.

2*⁻8      ⍝ 3
(*↢2)⁻9   ⍝ 3

Fast combinations

BPL computes this combination by an algorithm of its own, in any spelling. Trains says which spellings BPL recognises.

Combination Applies to Benefit
¯1+*Y or (*Y)-1 real Y expm1 keeps the digits of a small Y that subtracting 1 from *Y cancels

On complex numbers, ¯1+*Y computes *Y, then subtracts 1.

f←¯1+* ⋄ f 1E¯17         ⍝ 1ₑ¯17