Difference between revisions of "Maximum"

From APL Wiki
Jump to navigation Jump to search
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com")
Tags: Mobile web edit, Mobile edit
Line 30: Line 30:
=== Documentation ===
=== Documentation ===
* [http://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Maximum.htm Dyalog]
* [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Maximum.htm Dyalog]
* [http://microapl.com/apl_help/ch_020_020_100.htm APLX]
* [http://microapl.com/apl_help/ch_020_020_100.htm APLX]
* J [http://www.jsoftware.com/help/dictionary/d021.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/gtdot#dyadic NuVoc]
* J [http://www.jsoftware.com/help/dictionary/d021.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/gtdot#dyadic NuVoc]
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]]
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]]

Latest revision as of 14:38, 14 July 2020

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.


See also Minimum#examples.

Maximum finds the larger of two numbers:

      2.4  1.9

Maximum Reduce finds the largest element in a vector:

      / 4 3 2 7 5 1 3

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 3 2 7 5 1 3

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


APL built-ins [edit]
Primitive functions
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentitySelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndex
Selector Index generatorGradeIndex OfInterval IndexIndicesDeal
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Primitive operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-beamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Atop, Over) ∙ Inner ProductPowerAtUnderRankDepthVariantStencilCut (J)
Quad names
Arrays Index originMigration levelAtomic vector
Functions Case convertUnicode convert
Operators SearchReplace