Difference between revisions of "Times"

From APL Wiki
Jump to navigation Jump to search
m (Adám Brudzewsky moved page Product to Times over redirect: Use common name)
(Cleanup after move)
Line 1: Line 1:
 
:''This page describes the dyadic arithmetic function. For sign of a single argument, see [[Signum]].''
 
:''This page describes the dyadic arithmetic function. For sign of a single argument, see [[Signum]].''
  
{{Built-in|Product|×}}, '''Times''', or '''Multiply''' is a [[dyadic]] [[scalar function]] which gives the arithmetic product of its [[argument]]s. Product shares the [[glyph]] <source lang=apl inline>×</source> with the monadic arithmetic function [[Signum]], and its result is the left argument times the right argument.
+
{{Built-in|Times|×}}, '''Multiply''', or '''Product''' is a [[dyadic]] [[scalar function]] which gives the arithmetic product of its [[argument]]s. Times shares the [[glyph]] <source lang=apl inline>×</source> with the monadic arithmetic function [[Signum]].
  
 
== Examples ==
 
== Examples ==
A long, slow way to write <code>!10</code>:
+
A long, slow way to write <source lang=apl inline>!10</source>, assuming <source lang=apl inline>⎕IO←1</source>:
 
<source lang=apl>
 
<source lang=apl>
 
×/⍳10
 
×/⍳10
Line 11: Line 11:
 
== Properties ==
 
== Properties ==
  
Product is commutative: swapping the arguments don't affect the result, e.g. using [[Commute]], <source lang=apl inline>*⍨</source>.
+
Multiplication is [[wikipedia:Commutative property|commutative]] and [[wikipedia:Associative property|associative]], but, due to floating point error, may result in small differences between mathematically equivalent expressions.
  
=== Reduction and scan ===
+
The [[identity element]] for Times is <source lang=apl inline>1</source>.
  
[[Reduction]] with Product gives the product of the whole list.
+
=== Reduction ===
 +
 
 +
[[Reduction]] with Multiply gives the product of the whole list.
  
 
== External links ==
 
== External links ==

Revision as of 16:03, 26 April 2020

This page describes the dyadic arithmetic function. For sign of a single argument, see Signum.
×

Times (×), Multiply, or Product is a dyadic scalar function which gives the arithmetic product of its arguments. Times shares the glyph × with the monadic arithmetic function Signum.

Examples

A long, slow way to write !10, assuming ⎕IO1:

×/10

Properties

Multiplication is commutative and associative, but, due to floating point error, may result in small differences between mathematically equivalent expressions.

The identity element for Times is 1.

Reduction

Reduction with Multiply gives the product of the whole list.

External links

Documentation

APL built-ins [edit]
Primitive functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
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, Withe, Atop, Over) ∙ Inner ProductPowerAtUnderRankDepthVariantStencilCut (J)
Quad names
Arrays Index originMigration levelAtomic vector
Functions Name classCase convertUnicode convert
Operators SearchReplace