APL Symbols Meaning and Code Example

By Xah Lee. Date: . Last updated: .

This page is a list of APL symbol's meanings.

Monadic Functions

NameNotationMeaning
Roll ? One integer selected randomly from the first B integers
Ceiling โŒˆ Least integer greater than or equal to B
Floor โŒŠ Greatest integer less than or equal to B
Shape โด Number of components in each dimension of B
Not โˆผ Logical: โˆผ1 is 0, โˆผ0 is 1
Absolute value โˆฃ Magnitude of B
Index generator โณ Vector of the first B integers
Exponential โ‹† e to the B power
Negation โˆ’ Changes sign of B
Identity + No change to B
Signum ร— ยฏ1 if B<0; 0 if B=0; 1 if B>0
Reciprocal รท 1 divided by B
Ravel , Reshapes B into a vector
Matrix inverse โŒน Inverse of matrix B
Pi times โ—‹ Multiply by ฯ€
Logarithm โŸ Natural logarithm of B
Reversal โŒฝ Reverse elements of B along last axis
Reversal โŠ– Reverse elements of B along first axis
Grade up โ‹ Indices of B which will arrange B in ascending order
Grade down โ’ Indices of B which will arrange B in descending order
Execute โŽ Execute an APL expression
Monadic format โ• A character representation of B
Monadic transpose โ‰ Reverse the axes of B
Factorial ! Product of integers 1 to B

Dyadic functions

NameNotationMeaning
Add + Sum of A and B
Subtract โˆ’ A minus B
Multiply ร— A multiplied by B
Divide รท A divided by B
Exponentiation โ‹† A raised to the B power
Circle โ—‹ Trigonometric functions of B selected by A. A=1: sin(B) A=2: cos(B) A=3: tan(B)
Deal ? A distinct integers selected randomly from the first B integers
Membership โˆˆ 1 for elements of A present in B; 0 where not.
Maximum โŒˆ The greater value of A or B
Minimum โŒŠ The smaller value of A or B
Reshape โด Array of shape A with data B
Take โ†‘ Select the first (or last) A elements of B according to ร—A
Drop โ†“ Remove the first (or last) A elements of B according to ร—A
Decode โŠฅ Value of a polynomial whose coefficients are B at A
Encode โŠค Base-A representation of the value of B
Residue โˆฃ B modulo A
Catenation , Elements of B appended to the elements of A
Expansion \ Insert zeros (or blanks) in B corresponding to zeros in A
Compression / Select elements in B corresponding to ones in A
Index of โณ The location (index) of B in A; 1+โŒˆ/โณโดA if not found
Matrix divide โŒน Solution to system of linear equations Ax = B
Rotation โŒฝ The elements of B are rotated A positions
Rotation โŠ– The elements of B are rotated A positions along the first axis
Logarithm โŸ Logarithm of B to base A
Dyadic format โ• Format B into a character matrix according to A
General transpose โ‰ The axes of B are ordered by A
Combinations ! Number of combinations of B taken A at a time
Less than < Comparison: 1 if true, 0 if false
Less than or equal โ‰ค Comparison: 1 if true, 0 if false
Equal = Comparison: 1 if true, 0 if false
Greater than or equal โ‰ฅ Comparison: 1 if true, 0 if false
Greater than > Comparison: 1 if true, 0 if false
Not equal โ‰  Comparison: 1 if true, 0 if false
Or โˆจ Logic: 0 if A and B are 0; 1 otherwise
And โˆง Logic: 1 if A and B are 1; 0 otherwise
Nor โฑ Logic: 1 if both A and B are 0; otherwise 0
Nand โฒ Logic: 0 if both A and B are 1; otherwise 1

Operators and axis indicator

NameSymbolExampleMeaning (of example)
Reduce (last axis) / +/BSum across B
Reduce (first axis) โŒฟ +โŒฟBSum down B
Scan (last axis) \ +\BRunning sum across B
Scan (first axis) โ€ +โ€BRunning sum down B
Inner productโ—‡A+.ร—BMatrix product of A and B
Outer product โˆ˜ Aโˆ˜.ร—BOuter product of A and B