Add: Difference between revisions

Jump to navigation Jump to search
267 bytes added ,  02:12, 28 May 2022
mNo edit summary
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Built-in|Add|+}}, '''Plus''', '''Addition''', or '''Sum''', is a [[dyadic]] [[scalar function]] that [[wikipedia:Addition|adds]] numbers together. As a [[basic arithmetic]] operation, Add is subject to the language's [[number]] specification. Add shares the glyph <source lang=apl inline>+</source> with the [[monadic]] function [[Conjugate]], and is closely related to [[Subtract]] (<source lang=apl inline>-</source>).
{{Built-in|Add|+}}, '''Plus''', '''Addition''', or '''Sum''', is a [[dyadic]] [[scalar function]] that [[wikipedia:Addition|adds]] numbers together. As a basic arithmetic operation, Add is subject to the language's [[number]] specification. Add shares the glyph <source lang=apl inline>+</source> with the [[monadic]] function [[Conjugate]], and is closely related to [[Subtract]] (<source lang=apl inline>-</source>).


== Examples ==
== Examples ==
Line 17: Line 17:


Since adding a number to itself is equivalent to doubling that number, we can express the ''double'' function as <source lang=apl inline>+⍨</source>.
Since adding a number to itself is equivalent to doubling that number, we can express the ''double'' function as <source lang=apl inline>+⍨</source>.
=== Reduction ===
[[Reduction]] with Add gives the sum of the whole list.


== Scalar mapping ==
== Scalar mapping ==
Line 39: Line 43:


Addition of floating-point numbers may also be subject to [[overflow]], resulting in a [[DOMAIN ERROR]] or an [[infinite]] result.
Addition of floating-point numbers may also be subject to [[overflow]], resulting in a [[DOMAIN ERROR]] or an [[infinite]] result.
== See also ==
* [[Times]]
* [[Or]]
* [[Union]]


== External Links ==
== External Links ==
Line 44: Line 53:
=== Documentation ===
=== Documentation ===


* [http://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Add.htm Dyalog]
* [https://help.dyalog.com/latest/index.htm#Language/Primitive%20Functions/Add.htm Dyalog]
* [http://microapl.com/apl_help/ch_020_020_020.htm APLX]
* [http://microapl.com/apl_help/ch_020_020_020.htm APLX]
* [https://www.jsoftware.com/help/dictionary/d100.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/plus#dyadic J NuVoc]
* [https://www.jsoftware.com/help/dictionary/d100.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/plus#dyadic J NuVoc]
{{APL built-ins}}
* [https://mlochbaum.github.io/BQN/doc/arithmetic.html#basic-arithmetic BQN]
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar dyadic functions]]

Navigation menu