Difference between revisions of "Divide"

From APL Wiki
Jump to navigation Jump to search
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com")
Line 33: Line 33:
=== Documentation ===
=== Documentation ===
* [http://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Divide.htm Dyalog]
* [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Divide.htm Dyalog]
{{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:26, 14 July 2020

This page describes the dyadic arithmetic function. For reciprocal of a single argument, see Reciprocal.

Divide (÷) is a dyadic scalar function which gives the arithmetic ratio of its arguments. Divide shares the glyph ÷ with the monadic arithmetic function Reciprocal, and its result is the left argument divided by the right argument.


      2 0 5÷4 0 2
0.5 1 2.5
      3j1 2.5 4j5÷2 1j1 .2
1.5J0.5 1.25J¯1.25 20J25
      ⎕DIV1  ⍝ this sets division by 0 to always return 0
      2 0 5÷4 0 0
0.5 0 0


Division is anti-commutative: swapping the arguments yield the reciprocal of the result.

Reduction and scan

Reduction with Division gives the alternating product.

See also

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