Times: Difference between revisions
Jump to navigation
Jump to search
(→Documentation: BQN) |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
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|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>×</ | {{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>×</syntaxhighlight> with the monadic arithmetic function [[Signum]]. | ||
== Examples == | == Examples == | ||
A long, slow way to write <source lang=apl inline>!10</ | A long, slow way to write <source lang=apl inline>!10</syntaxhighlight>, assuming <source lang=apl inline>⎕IO←1</syntaxhighlight>: | ||
<source lang=apl> | <source lang=apl> | ||
×/⍳10 | ×/⍳10 | ||
</ | </syntaxhighlight> | ||
== Properties == | == Properties == | ||
Line 13: | Line 13: | ||
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. | 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. | ||
The [[identity element]] for Times is <source lang=apl inline>1</ | The [[identity element]] for Times is <source lang=apl inline>1</syntaxhighlight>. | ||
=== Reduction === | === Reduction === | ||
Line 30: | Line 30: | ||
* [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Multiply.htm Dyalog] | * [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Multiply.htm Dyalog] | ||
* [http://microapl.com/apl_help/ch_020_020_060.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_060.htm APLX] | ||
* J [https://www.jsoftware.com/help/dictionary/d110.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/star#dyadic NuVoc] (as <source lang=j inline>*</ | * J [https://www.jsoftware.com/help/dictionary/d110.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/star#dyadic NuVoc] (as <source lang=j inline>*</syntaxhighlight>) | ||
* [https://mlochbaum.github.io/BQN/doc/arithmetic.html#basic-arithmetic BQN] | * [https://mlochbaum.github.io/BQN/doc/arithmetic.html#basic-arithmetic BQN] | ||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]] |
Revision as of 10:29, 11 September 2022
- 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 <source lang=apl inline>×</syntaxhighlight> with the monadic arithmetic function Signum.
Examples
A long, slow way to write <source lang=apl inline>!10</syntaxhighlight>, assuming <source lang=apl inline>⎕IO←1</syntaxhighlight>: <source lang=apl> ×/⍳10 </syntaxhighlight>
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 <source lang=apl inline>1</syntaxhighlight>.
Reduction
Reduction with Multiply gives the product of the whole list.
See also
External links
Documentation
- Dyalog
- APLX
- J Dictionary, NuVoc (as <source lang=j inline>*</syntaxhighlight>)
- BQN