Content deleted Content added
m Bypass redirect in merge template – apparently Unary operator moved to Unary operation Tag: Reverted |
|||
(12 intermediate revisions by 9 users not shown) | |||
Line 1:
{{Short description|Function that takes one argument}}
{{Multiple issues|
{{refimprove|date=August 2012}}▼
{{one source |date=May 2024}}
{{No footnotes|date=December 2024}}
}}
In [[mathematics]], a '''unary function''' is a [[function (mathematics)|function]] that takes one [[Arity|argument]]. A [[unary operator]] belongs to a subset of unary functions, in that its [[codomain]] coincides with its [[___domain of a function|___domain]]. In contrast, a unary function's ___domain need not coincide with its range.
==
The [[successor function]], denoted <math>\operatorname{succ}</math>, is a unary operator. Its ___domain and codomain are the [[natural number]]s; its definition is as follows:
: <math display="block">
\begin{align}
\operatorname{succ} : \quad & \mathbb{N} \rightarrow \mathbb{N} \\
& n \mapsto (n + 1)
\end{align}
</math>
In some [[programming language]]s such as [[C (programming language)|C]], executing this operation is denoted by [[Reverse Polish notation|postfixing]] {{code|++}} to the operand, i.e. the use of {{code|n++}} is equivalent to executing the assignment <math> n:= \operatorname{succ}(n)</math>.
Many of the [[elementary function]]s are unary functions, including the [[trigonometric functions]], [[logarithm]] with a specified base, [[exponentiation]] to a particular power or base, and [[hyperbolic function]]s.
== See also ==
* [[Arity]]
* [[Binary function]]
* [[Binary operation]]
* [[Iterated binary operation]]
* [[Ternary operation]]
* [[Unary operation]]
== Bibliography ==
* [http://www.cs.ucl.ac.uk/staff/W.Langdon/FOGP Foundations of Genetic Programming]
{{Authority control}}
[[Category:Functions and mappings]]
[[Category:Types of functions]]
[[Category:Unary operations|*]]
{{maths-stub}}
|