Changes

Jump to navigation Jump to search

Scalar function

648 bytes added, 09:06, 29 October 2019
m
Text replacement - "<code>" to "<source lang=apl inline>"
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 <codesource lang=apl inline>~</code> with non-scalar dyad [[Without]], and similarly scalar [[Roll]] and non-scalar [[Deal]] are both written <codesource lang=apl inline>?</code>.
== Standard scalar functions ==
{|
| <codesource lang=apl inline>+</code> || [[Conjugate]]
|-
| <codesource lang=apl inline>-</code> || [[Negate]]
|-
| <codesource lang=apl inline>×</code> || [[Signum]] or Direction
|-
| <codesource lang=apl inline>÷</code> || [[Reciprocal]]
|-
| <codesource lang=apl inline>⌊</code> || [[Floor]]
|-
| <codesource lang=apl inline>⌈</code> || [[Ceiling]]
|-
| <codesource lang=apl inline>*</code> || [[Exponential]]
|-
| <codesource lang=apl inline>⍟</code> || [[Natural Logarithm]]
|-
| <codesource lang=apl inline><nowiki>|</nowiki></code> || [[Magnitude]]
|-
| <codesource lang=apl inline>!</code> || [[Factorial]]
|-
| <codesource lang=apl inline>○</code> || [[Pi Times]]
|-
| <codesource lang=apl inline>~</code> || [[Not]]
|-
| <codesource lang=apl inline>∊</code> || [[Type]]
|}
{|
| <codesource lang=apl inline>+</code> || [[Plus]]
|-
| <codesource lang=apl inline>-</code> || [[Minus]]
|-
| <codesource lang=apl inline>×</code> || [[Times]]
|-
| <codesource lang=apl inline>÷</code> || [[Divide]]
|-
| <codesource lang=apl inline>⌊</code> || [[Minimum]]
|-
| <codesource lang=apl inline>⌈</code> || [[Maximum]]
|-
| <codesource lang=apl inline>*</code> || [[Power function]]
|-
| <codesource lang=apl inline>⍟</code> || [[Logarithm]]
|-
| <codesource lang=apl inline><nowiki>|</nowiki></code> || [[Residue]]
|-
| <codesource lang=apl inline>!</code> || [[Binomial]] coefficient or combination function
|-
| <codesource lang=apl inline>○</code> || [[Circle function]]
|-
| <codesource lang=apl inline>∧</code> || [[Logical And]]
|-
| <codesource lang=apl inline>∨</code> || [[Logical Or]]
|-
| <codesource lang=apl inline>⍲</code> || [[Nand]]
|-
| <codesource lang=apl inline>⍱</code> || [[Nor]]
|-
| <codesource lang=apl inline><</code> || [[Less than]]
|-
| <codesource lang=apl inline>≤</code> || [[Less than or equal to]]
|-
| <codesource lang=apl inline>=</code> || [[Equal to]]
|-
| <codesource lang=apl inline>≥</code> || [[Greater than or equal to]]
|-
| <codesource lang=apl inline>></code> || [[Greather than]]
|-
| <codesource lang=apl inline>≠</code> || [[Not equal to]]
|}

Navigation menu