- This page is about the primitive function. For system limits, see LIMIT ERROR and Maximum rank.
Maximum (⌈
), Max, Greater of, or Larger of is a dyadic scalar function which returns the larger of its two arguments. The name "Maximum" is sometimes also used for the Maximum Reduce ⌈/
, which returns the largest element of a vector (this usage is related to the maximum of a function). Maximum is paired with Minimum, and shares the glyph ⌈
with the Ceiling function. It is not subject to comparison tolerance, since the result will be exactly equal to one argument, and there is no reason to choose a smaller argument even if the two arguments are tolerantly equal. As a Boolean function, Maximum is identical to Or.
Examples
- See also Minimum#examples.
Maximum finds the larger of two numbers:
2.4 ⌈ 1.9
2.4
Maximum Reduce finds the largest element in a vector:
⌈/ 4 3 2 7 5 1 3
7
The index of this element can be found with Index Of, but is also the First element of the Grade Down of the vector.
{⍵⍳⌈/⍵} 4 3 2 7 5 1 3
4
⊃⍒ 4 3 2 7 5 1 3
4
Reducing over an empty axis yields the smallest representable number, as that is the identity element for Maximum. This value is usually ¯∞
(for dialects that support infinities) or ¯1.797693135E308
(with 64-bit floats) or ¯1E6145
(with 128-bit decimal floats).
External links
Documentation
APL built-ins [edit]
|
Primitives (Timeline) |
Functions
|
Scalar
|
Monadic
|
Conjugate ∙ Negate ∙ Signum ∙ Reciprocal ∙ Magnitude ∙ Exponential ∙ Natural Logarithm ∙ Floor ∙ Ceiling ∙ Factorial ∙ Not ∙ Pi Times ∙ Roll ∙ Type ∙ Imaginary ∙ Square Root ∙ Round
|
Dyadic
|
Add ∙ Subtract ∙ Times ∙ Divide ∙ Residue ∙ Power ∙ Logarithm ∙ Minimum ∙ Maximum ∙ Binomial ∙ Comparison functions ∙ Boolean functions (And, Or, Nand, Nor) ∙ GCD ∙ LCM ∙ Circular ∙ Complex ∙ Root
|
Non-Scalar
|
Structural
|
Shape ∙ Reshape ∙ Tally ∙ Depth ∙ Ravel ∙ Enlist ∙ Table ∙ Catenate ∙ Reverse ∙ Rotate ∙ Transpose ∙ Raze ∙ Mix ∙ Split ∙ Enclose ∙ Nest ∙ Cut (K) ∙ Pair ∙ Link ∙ Partitioned Enclose ∙ Partition
|
Selection
|
First ∙ Pick ∙ Take ∙ Drop ∙ Unique ∙ Identity ∙ Stop ∙ Select ∙ Replicate ∙ Expand ∙ Set functions (Intersection ∙ Union ∙ Without) ∙ Bracket indexing ∙ Index ∙ Cartesian Product ∙ Sort
|
Selector
|
Index generator ∙ Grade ∙ Index Of ∙ Interval Index ∙ Indices ∙ Deal ∙ Prefix and suffix vectors
|
Computational
|
Match ∙ Not Match ∙ Membership ∙ Find ∙ Nub Sieve ∙ Encode ∙ Decode ∙ Matrix Inverse ∙ Matrix Divide ∙ Format ∙ Execute ∙ Materialise ∙ Range
|
Operators |
Monadic
|
Each ∙ Commute ∙ Constant ∙ Replicate ∙ Expand ∙ Reduce ∙ Windowed Reduce ∙ Scan ∙ Outer Product ∙ Key ∙ I-Beam ∙ Spawn ∙ Function axis ∙ Identity (Null, Ident)
|
Dyadic
|
Bind ∙ Compositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner Product ∙ Determinant ∙ Power ∙ At ∙ Under ∙ Rank ∙ Depth ∙ Variant ∙ Stencil ∙ Cut ∙ Direct definition (operator) ∙ Identity (Lev, Dex)
|
Quad names
|
Index origin ∙ Comparison tolerance ∙ Migration level ∙ Atomic vector
|