Scalar function: Difference between revisions

Jump to navigation Jump to search
648 bytes added ,  09:06, 29 October 2019
m
Text replacement - "<code>" to "<source lang=apl inline>"
Miraheze>Marshall
Miraheze>Adám Brudzewsky
m (Text replacement - "<code>" to "<source lang=apl inline>")
Line 1: Line 1:
A scalar function is one of a class of primitive functions that apply to arguments one [[element]] at a time. Dyadic scalar functions pair elements of their arguments based on [[conformability]] rules, and thus are subject to [[scalar extension]]. In [[Nested array model|nested]] array languages scalar functions recursively descend into nested arrays until they can be applied to [[simple scalars]]; in [[Flat array model|flat]] array languages they usually do not apply inside [[boxes]].
A scalar function is one of a class of primitive functions that apply to arguments one [[element]] at a time. Dyadic scalar functions pair elements of their arguments based on [[conformability]] rules, and thus are subject to [[scalar extension]]. In [[Nested array model|nested]] array languages scalar functions recursively descend into nested arrays until they can be applied to [[simple scalars]]; in [[Flat array model|flat]] array languages they usually do not apply inside [[boxes]].


Only a particular [[valence]] of a function is labelled "scalar". The scalar monad [[Not]] usually shares the glyph <code>~</code> with non-scalar dyad [[Without]], and similarly scalar [[Roll]] and non-scalar [[Deal]] are both written <code>?</code>.
Only a particular [[valence]] of a function is labelled "scalar". The scalar monad [[Not]] usually shares the glyph <source lang=apl inline>~</code> with non-scalar dyad [[Without]], and similarly scalar [[Roll]] and non-scalar [[Deal]] are both written <source lang=apl inline>?</code>.


== Standard scalar functions ==
== Standard scalar functions ==
Line 10: Line 10:


{|
{|
| <code>+</code> || [[Conjugate]]
| <source lang=apl inline>+</code> || [[Conjugate]]
|-
|-
| <code>-</code> || [[Negate]]
| <source lang=apl inline>-</code> || [[Negate]]
|-
|-
| <code>×</code> || [[Signum]] or Direction
| <source lang=apl inline>×</code> || [[Signum]] or Direction
|-
|-
| <code>÷</code> || [[Reciprocal]]
| <source lang=apl inline>÷</code> || [[Reciprocal]]
|-
|-
| <code>⌊</code> || [[Floor]]
| <source lang=apl inline>⌊</code> || [[Floor]]
|-
|-
| <code>⌈</code> || [[Ceiling]]
| <source lang=apl inline>⌈</code> || [[Ceiling]]
|-
|-
| <code>*</code> || [[Exponential]]
| <source lang=apl inline>*</code> || [[Exponential]]
|-
|-
| <code>⍟</code> || [[Natural Logarithm]]
| <source lang=apl inline>⍟</code> || [[Natural Logarithm]]
|-
|-
| <code><nowiki>|</nowiki></code> || [[Magnitude]]
| <source lang=apl inline><nowiki>|</nowiki></code> || [[Magnitude]]
|-
|-
| <code>!</code> || [[Factorial]]
| <source lang=apl inline>!</code> || [[Factorial]]
|-
|-
| <code>○</code> || [[Pi Times]]
| <source lang=apl inline>○</code> || [[Pi Times]]
|-
|-
| <code>~</code> || [[Not]]
| <source lang=apl inline>~</code> || [[Not]]
|-
|-
| <code>∊</code> || [[Type]]
| <source lang=apl inline>∊</code> || [[Type]]
|}
|}


Line 40: Line 40:


{|
{|
| <code>+</code> || [[Plus]]
| <source lang=apl inline>+</code> || [[Plus]]
|-
|-
| <code>-</code> || [[Minus]]
| <source lang=apl inline>-</code> || [[Minus]]
|-
|-
| <code>×</code> || [[Times]]
| <source lang=apl inline>×</code> || [[Times]]
|-
|-
| <code>÷</code> || [[Divide]]
| <source lang=apl inline>÷</code> || [[Divide]]
|-
|-
| <code>⌊</code> || [[Minimum]]
| <source lang=apl inline>⌊</code> || [[Minimum]]
|-
|-
| <code>⌈</code> || [[Maximum]]
| <source lang=apl inline>⌈</code> || [[Maximum]]
|-
|-
| <code>*</code> || [[Power function]]
| <source lang=apl inline>*</code> || [[Power function]]
|-
|-
| <code>⍟</code> || [[Logarithm]]
| <source lang=apl inline>⍟</code> || [[Logarithm]]
|-
|-
| <code><nowiki>|</nowiki></code> || [[Residue]]
| <source lang=apl inline><nowiki>|</nowiki></code> || [[Residue]]
|-
|-
| <code>!</code> || [[Binomial]] coefficient or combination function
| <source lang=apl inline>!</code> || [[Binomial]] coefficient or combination function
|-
|-
| <code>○</code> || [[Circle function]]
| <source lang=apl inline>○</code> || [[Circle function]]
|-
|-
| <code>∧</code> || [[Logical And]]
| <source lang=apl inline>∧</code> || [[Logical And]]
|-
|-
| <code>∨</code> || [[Logical Or]]
| <source lang=apl inline>∨</code> || [[Logical Or]]
|-
|-
| <code>⍲</code> || [[Nand]]
| <source lang=apl inline>⍲</code> || [[Nand]]
|-
|-
| <code>⍱</code> || [[Nor]]
| <source lang=apl inline>⍱</code> || [[Nor]]
|-
|-
| <code><</code> || [[Less than]]
| <source lang=apl inline><</code> || [[Less than]]
|-
|-
| <code>≤</code> || [[Less than or equal to]]
| <source lang=apl inline>≤</code> || [[Less than or equal to]]
|-
|-
| <code>=</code> || [[Equal to]]
| <source lang=apl inline>=</code> || [[Equal to]]
|-
|-
| <code>≥</code> || [[Greater than or equal to]]
| <source lang=apl inline>≥</code> || [[Greater than or equal to]]
|-
|-
| <code>></code> || [[Greather than]]
| <source lang=apl inline>></code> || [[Greather than]]
|-
|-
| <code>≠</code> || [[Not equal to]]
| <source lang=apl inline>≠</code> || [[Not equal to]]
|}
|}

Navigation menu