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, and xᵣy is the exact quotient of xₓ by yₓ, under static kinds too. After a name, or any item but a number or a list of literals, ₓ floors the item’s numbers to exact integers. xₓ is ⌊ₓx:
After a function, ₓ floors its results to ordinary integers under either kinds setting. Numbers gives the static conversion rules.
⌊ₓ, ⌈ₓ and dyadic ÷ₓ, which divides and floors as Python’s // does, each compute their integers in one pass:
The sized integer markers ₓ₁, ₓ₂, ₓ₄ and ₓ₈ give fixed integers occupying 1, 2, 4 or 8 bytes. The full digit run after ₓ is the width: ₓ₁₆ is invalid. Parenthesize a conversion before indexing, as in (vₓ₁)₂. Fixed-width integers gives the conversion and promotion rules.
After a function, a sized marker converts the function’s results:
A float width’s marker, ₕ, ₛ or ₚ, works the same way. After a function it makes the function’s results floats of that width, and after an array it converts the array, as •float does:
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: ₓ on a complex number, or under dynamic kinds on an infinity or NaN, as in 1÷ₓ0BPL also accepts Dyalog’s x*2, f⍣2 and f⍣¯1. BQN writes the inverse as 𝔽⁼. Neither language has subscripts.