v←10 20 30
v₁²400
A superscript, such as ², is a mark written straight after a token that applies an operation to it. A subscript, such as ₁, selects from it instead. Both bind more tightly than any function. v₁² is the square of item 1 of v:
Typing glyphs gives their keys.
On an array, a superscript digit is a power:
A power of ¯1, written ⁻¹, is the reciprocal:
ᵀ swaps rows and columns:
In 2 3², the superscript touches only the 3:
In [2 3]², it touches the whole list:
After a space, a superscript applies to the whole run on its left:
The run can be any expression, such as ≥x:
A strand of names is several runs, one for each name:
A spaced superscript also needs a space after it:
On a function, a superscript digit is a repeat count, as in Power. f² is f⍣2:
f⁻¹ is the inverse of f, the same as f⍣¯1. f⁻¹ Y gives the X for which f X is Y. Inverses follow BQN’s specification of inferred properties. The inverse of the exponential * is the natural logarithm:
Monadic Encode, ⊤, gives a number’s binary digits. Its inverse reads the digits back into a number:
In a dyadic call, X f⁻¹ Y is the Z for which X f Z is Y. The inverses of 2× and 2* are division by 2 and the base-2 logarithm:
Inverting Replicate puts fill where the mask has zeros:
A superscript applies to the whole function on its left, as a monadic operator does. +\⁻¹ turns running sums back into the numbers they came from:
The same goes for a derived function such as -¨:
A bound function such as 2↣× inverts as a whole too:
A superscript just after a number applies to the number, as a power. Without parentheses, +↢3⁻¹ adds a third. To invert a function that ends in a number, put the function in parentheses:
A space before the superscript also works:
With the axis operator, the inverse can also go before ⍠. #⁻¹⍠¯1 is the same function as (#⍠¯1)⁻¹.
Inverses follow the rules of Power. They pass through bound arguments, Each, Rank and the other compositions that Power lists. f⁻¹←g attaches an inverse to any function that a name holds.
ᵇ, Bitwise, is a monadic operator that applies a Boolean function to integer bits. For example, 6∧ᵇ3 is 2ₓ.
fᵘ is a scalar holding the function f, as ⊂ encloses a subject. ⊂ can’t enclose a function, because written next to one it forms a train. Like any scalar, +ᵘ has an empty shape:
Its depth counts the one layer around the function:
DOMAIN: a function with no known inverse, ᵀ on a function, or ᵘ on an arraySYNTAX: a superscript after a space that doesn’t stand alone, as in 2 3 ²+1A subscript selects a major cell of the item just before it. v₁ is 1⌷v:
A negative subscript counts from the end:
On a matrix, a subscript selects a row:
After a dotted path, a subscript selects from the whole path:
With a space before it, a subscript selects from the whole run on its left:
As with a superscript, the run can be any expression:
A spaced subscript also needs a space after it.
A subscripted item can be an assignment target:
Modified assignment works too:
Use a subscript for one literal position on the leading axis. Use Index, ⌷, for a computed position, several positions, a key or another axis.
The subscript letters ₓ, ⱼ, ₑ and ᵣ are parts of numbers, as in 3ₓ and 1ᵣ3. Numbers covers them. Between two other items, such as names, ⱼ, ₑ and ᵣ join the items into one number: xⱼy is x+y×0ⱼ1. After a name, or any item but a number or a list of literals, ₓ is ⌊:
SYNTAX: a subscript after a space that doesn’t stand alone, as in 2 3 ₁+1, or that is an assignment target, as in v ₁←5SYNTAX: ₋ with no digit after itSYNTAX: ⱼ, ₑ or ᵣ beside a function or a space, as in f←- ⋄ fⱼ1INDEX: the position is outside the leading axisLENGTH: the item is a unit, which has no axis to select fromDOMAIN: ₓ after a function, as in +ₓBPL also accepts Dyalog’s x*2, f⍣2 and f⍣¯1. BQN writes the inverse as 𝔽⁼. Neither language has subscripts.