Complex Conjugate | +X | +23 0 ¯31 1J1 ⇔ 23 0 ¯31 1J¯1 | | Add | A+B | 75 3 46 + 5 ¯2 8 ⇔ 80 1 54 |
Negate | -X | -1 ¯17 44.8 ⇔ ¯1 17 ¯44.8 | | Subtract | A-B | 75 3 46 - 5 ¯2 8 ⇔ 70 5 38 |
Signum | ×X | ×56.2 ¯1.4 0 0J¯3 ⇔ 1 ¯1 0 0J¯1 | | Multiply | A×B | 75 3 46 × 5 ¯2 8 ⇔ 375 ¯6 368 |
Reciprocal | ÷X | ÷1 2 3 4 ⇔ 1 0.5 0.3333333333 0.25 | | Divide | A÷B | 75 3 46 ÷ 5 ¯2 8 ⇔ 15 ¯1.5 5.75 |
Magnitude | |X | |23 0 ¯31 1J1 ⇔ 23 0 31 1.414213562 | | Residue (Remainder) | A|B | 3|15.4 ¯21 ¯23 9 8 ⇔ 0.4 0 1 0 2 |
Exponential (eX) | *X | *1 2 ⇔ 2.718281828 7.389056099 | | Power | A*B | 3 7 16 * 3 2 0.5 ⇔ 27 49 4 |
Natural Logarithm | ⍟X | ⍟2.718281828 10 ⇔ 1 2.302585093 | | Logarithm (Base A ) | A⍟B | 2⍟1023 ⇔ 9.99859043 |
Ceiling | ⌈X | ⌈ ¯2.8 ¯1.1 0 1.1 2.5 ⇔ ¯2 ¯1 0 2 3 | | Maximum | A⌈B | 4 17 ¯2 ⌈ 3 64.8 1 ⇔ 4 64.8 1 |
Floor | ⌊X | ⌊ ¯2.8 ¯1.1 0 1.1 2.5 ⇔ ¯3 ¯2 0 1 2 | | Minimum | A⌊B | 4 17 ¯2 ⌊ 3 64.8 1 ⇔ 3 17 ¯2 |
Factorial | !X | !14 ⇔ 87178291200 | | Binomial Coefficient | A!B | Number of combinations of B items taken A at a time |
Pi Times | ○X | ○÷180 ⇔ 0.01745329252 | | Circular Functions | A○B | See table below |
Roll | ?X | Randomly choose an item from ⍳X | | Deal | A?B | Randomly choose A items from ⍳B without replacement |
| | Base Value | A⊥B | 2⊥0 1 0 0 0 1 ⇔ 17 |
| | Representation | A⊤B | 2 2 2 2 2 2 ⊤ 17 ⇔ 0 1 0 0 0 1 |
Grade Up | ⍋X | List of indices that will sort X in ascending order | | Grade Up | A⍋B | Alphabetic sort: A gives the collating sequence |
Grade Down | ⍒X | List of indices that will sort X in descending order | | Grade Down | A⍒B | Alphabetic sort: A gives the collating sequence |
Matrix Inverse | ⌹X |
| | Matrix Divide | A⌹B | Multiply A by the inverse of matrix B |
Execute | ⍎X | Evaluate APL2 expression given as character vector X | | |
|
|
Format | ⍕X | ⍕¯17.5 ⇔ '¯17.5' | | Format | A⍕B | 0 3 4 0 6 ¯2⍕ ¯12.14 30 17.1 ⇔ '¯12.140 30 1.7E1'
'06/06/0006' ⍕ 7 20 1969 ⇔ '07/20/1969' |
| | Expand | A\B | 1 0 0 1 1 0 1\3 1 4 2 ⇔ 3 0 0 1 4 0 2 |
| | Expand | A⍀B | Expand along the first axis of B |
| | Replicate | A/B | 2 0 ¯5 3 1/3 1 4 2 ⇔ 3 3 0 0 0 0 0 4 4 4 2 |
| | Replicate | A⌿B | Replicate along the first axis of B |
| | Index | A⌷B | Select items from B using indices A |
Index Generator | ⍳X | ⍳8 ⇔ 1 2 3 4 5 6 7 8 | | Index Of | A⍳B | 'HELLO'⍳'ELP' ⇔ 2 3 6 |
Not (see Boolean Functions) | | Without | A~B | (⍳8)~1 4 5 ⇔ 2 3 6 7 8 |
Shape of | ρX | List of dimensions of X | | Reshape | AρB | 3 4ρ'ABCDEFGHIJKL' ⇔ ABCD EFGH IJKL
|
Reverse | ⌽X | ⌽⍳8 ⇔ 8 7 6 5 4 3 2 1 | | Rotate | A⌽B | 3⌽⍳8 ⇔ 4 5 6 7 8 1 2 3 |
Reverse Vertically | ⊖X | ⊖3 4ρ'ABCDEFGHIJKL' ⇔ IJKL EFGH ABCD
| | Rotate Vertically | A⊖B | 1⊖3 4ρ'ABCDEFGHIJKL' ⇔ EFGH IJKL ABCD
|
Transpose | ⍉X | ⍉3 4ρ'ABCDEFGHIJKL' ⇔ AEI BFJ CGK DHL
| | Transpose | A⍉B | The elements of A give the new order for the axes of B |
First | ↑X | The first element of X | | Take | A↑B | ¯3↑⍳8 ⇔ 6 7 8 |
| | Drop | A↓B | 3↓⍳8 ⇔ 4 5 6 7 8 |
Enclose | ⊂X | Represent array X as a scalar | | Partition | A⊂B | 1 0 1 1 2 2 2 3 ⊂ 'ABCDEFGH' ⇔
┌→─────────────────┐
│┌→┐ ┌→─┐ ┌→──┐ ┌→┐│
││A│ │CD│ │EFG│ │H││
│└─┘ └──┘ └───┘ └─┘│
└∊─────────────────┘
|
Disclose | ⊃X | Remove one level of nesting from X | | Pick | A⊃B | Indices A select an item from within nested array B |
Depth | ≡X | Deepest level of nesting in X | | Match (see Boolean Functions) |
Ravel | ,X | Change X to a vector, preserving depth | | Catenate | A,B | Connect two arrays along their last axis |
Enlist | ∈X | Change X to a vector of depth 1 | | Membership (see Boolean Functions) |
Each | f¨X | Apply function f to each item of X |
Reduction | f/X | Apply function f along the last axis (rows) of X |
Reduction | f⌿X | Apply function f along the first axis of X |
N-Wise Reduction | A f/B | Apply function f along the last axis (rows) of B with a moving window of size A |
N-Wise Reduction | A f⌿B | Apply function f along the first axis of B with a moving window of size A |
Scan | f\X | Apply function f along the last axis (rows) of X , displaying intermediate results |
Scan | f⍀X | Apply function f along the first axis of X , displaying intermediate results |
Inner Product | A f.g B | Apply function g between rows of A and corresponding columns of B , then apply f along each result |
Outer Product | A ∘.f B | Apply function f between every combination of one element from A and one element from B |