APL function symbols
From Wikipedia, the free encyclopedia
The following APL functions are given, separated into their monadic and dyadic forms. For non-standard characters, a hexadecimal UCS-2 index value is given. The names given are the original names of the functions implemented by the symbol. Some functions, such as the monadic shape and index generator functions, are commonly known by the name of the symbol (rho and iota).
For the symbols on this page to be displayed properly, it may be necessary to use a CSS2-compliant browser such as Mozilla Firefox or Safari.
Contents |
[edit] Monadic functions
Name | Example | Meaning | UCS-2 Hex |
---|---|---|---|
Roll | ?B | Integer selected randomly from 1 through B (see note) | 003F |
Ceiling | ⌈B | Least integer greater than or equal to B | 2308 |
Floor | ⌊B | Greatest integer less than or equal to B | 230A |
Shape | ⍴B | Number of components in each dimension of B | 2374 |
Not | ∼B | Logical: ∼1 is 0, ∼0 is 1 | 223C |
Absolute value | ∣B | Magnitude of B | 2223 |
Index generator | ⍳B | Vector of integers from 1 to B (see note) | 2373 |
Exponential | ⋆B | e to the B power | 22C6 |
Negation | −B | Changes sign of B | 2212 |
Identity | +B | No change to B | 002B |
Signum | ×B | ¯1 if B<0; 0 if B=0; 1 if B>0 | 00D7 |
Reciprocal | ÷B | 1 divided by B | 00F7 |
Ravel | ,B | Reshapes B into a vector | 002C |
Matrix inverse | ⌹B | Inverse of B | 2339 |
Pi times | ○B | Multiply by π | 25CB |
Logarithm | ⍟B | Natural logarithm of B | 235F |
Reversal | ⌽B | Reverse elements of B | 233D |
Reversal | ⊖B | Reverse elements of B along 1st dimension | 2296 |
Grade up | ⍋B | Indices of B which will arrange B in ascending order | 234B |
Grade down | ⍒B | Indices of B which will arrange B in descending order | 2352 |
Execute | ⍎B | Execute an APL expression | 234E |
Monadic format | ⍕B | A character matrix representation of B | 2355 |
Monadic transpose | ⍉B | Reverse the dimensions of B | 2349 |
Factorial | !B | Product of integers 1 to B | 0021 |
Note: The choice of index origin (a user selectable system variable, either 0 or 1) affects the result of roll and index functions. The tabulated definitions are valid when index origin is 1.
[edit] Dyadic functions
Name | Example | Meaning | UCS-2 Hex |
---|---|---|---|
Add | A+B | Sum of A and B | 002B |
Subtract | A−B | A minus B | 2212 |
Multiply | A×B | A multiplied by B | 00D7 |
Divide | A÷B | A divided by B | 00F7 |
Exponentiation | A⋆B | A raised to the B power | 22C6 |
Circle | A○B | Trigonometric functions of B selected by A A=1: sin(B) A=2: cos(B) A=3: tan(B) |
25CB |
Deal | A?B | A distinct integers selected randomly from set 1 to B (see note) | 003F |
Membership | A∈B | 1 if A is present in B; otherwise 0 | 2208 |
Maximum | A⌈B | The greater value of A or B | 2308 |
Minimum | A⌊B | The smaller value of A or B | 230A |
Reshape | A⍴B | Array of shape A with data B | 2374 |
Take | A↑B | Select the first ∣A elements of B | 2191 |
Drop | A↓B | Remove the first ∣A elements of B | 2193 |
Decode | A⊥B | Value of a polynomial whose coefficients are B at A | 22A5 |
Encode | A⊤B | Base-A representation of the value of B | 22A4 |
Residue | A∣B | The A modula value of B lying between A and 0 | 2223 |
Catenation | A,B | Elements of B appended to the elements of A | 002C |
Expansion | A\B | Insert zeros (or blanks) in B corresponding to zeros in A | 005C |
Compression | A/B | Select elements in B corresponding to ones in A | 002F |
Index of | A⍳B | The location (index) of B in A; 1+⍴B if not found (see note) | 2373 |
Matrix divide | A⌹B | Solution to system of linear equations Ax = B | 2339 |
Rotation | A⌽B | The elements of B are rotated A positions | 233D |
Rotation | A⊖B | The elements of B are rotated A positions in the 1st dimension | 2296 |
Logarithm | A⍟B | Logarithm of B to base A | 235F |
Dyadic format | A⍕B | Format B into a character matrix according to A | 2355 |
General transpose | A⍉B | The dimensions of B are ordered by A | 2349 |
Combinations | A!B | Number of combinations of B taken A at a time | 0021 |
Less than | A<B | Comparison: 1 if true, 0 if false | 003C |
Less than or equal | A≤B | Comparison: 1 if true, 0 if false | 2264 |
Equal | A=B | Comparison: 1 if true, 0 if false | 003D |
Greater than or equal | A≥B | Comparison: 1 if true, 0 if false | 2265 |
Greater than | A>B | Comparison: 1 if true, 0 if false | 003E |
Not equal | A≠B | Comparison: 1 if true, 0 if false | 2260 |
Or | A∨B | Logic: 0 if A and B are 0; 1 otherwise | 2228 |
And | A∧B | Logic: 1 if A and B are 1; 0 otherwise | 2227 |
Nor | A⍱B | Logic: 1 if both A and B are 0; otherwise 0 | 2371 |
Nand | A⍲B | Logic: 0 if both A and B are 1; otherwise 1 | 2372 |
Note: The choice of index origin (a user selectable system variable, either 0 or 1) affects the result of deal and index functions. The tabulated definitions are valid when index origin is 1.
[edit] References
- Polivka, Raymond P.; & Pakin, Sandra (1975). APL: The Language and Its Usage. Prentice-Hall. ISBN 0-13-038885-8.
[edit] External links
- APL character reference Page 1
- APL character reference Page 2
- APL character reference Page 3
- APL character reference Page 4