Unary function: Difference between revisions

Content deleted Content added
 
(27 intermediate revisions by 18 users not shown)
Line 1:
{{Short description|Function that takes one argument}}
{{refimprove|date=August 2012}}
{{Multiple issues|
A '''unary function''' is a [[function (mathematics)|function]] that takes one [[Parameter (computer science)|argument]]. In [[computer science]], a [[unary operator]] is a subset of unary function.
{{one source |date=May 2024}}
{{No footnotes|date=December 2024}}
}}
<!-- {{refimprovemore citations needed|date=August 2012}} -->
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.
 
== Examples ==
Example :-
a++
here a is an operand which is operated by a unary operator++.
it can be written in the form
a=a+1.
Many of the [[elementary function]]s are unary functions, in particular the [[trigonometric functions]], [[logarithm]] with a pre-specified base, [[exponentiation]] to a pre-specified power or from a pre-specified base, and [[hyperbolic function]] are unary.
 
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:
==See also==
: <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>.
*[[Arity]]
*[[Binary function]]
*[[Binary operator]]
*[[List of mathematical functions]]
*[[Ternary operation]]
*[[Unary operation]]
*[[Secondary operation]]
 
Many of the [[elementary function]]s are unary functions, in particularincluding the [[trigonometric functions]], [[logarithm]] with a pre-specified base, [[exponentiation]] to a pre-specifiedparticular power or from a pre-specified base, and [[hyperbolic function]] are unarys.
==References==
 
== See also ==
 
* [[Arity]]
* [[Binary function]]
* [[Binary operatoroperation]]
* [[SecondaryIterated binary operation]]
* [[Ternary operation]]
* [[Unary operation]]
 
== Bibliography ==
* [http://www.cs.ucl.ac.uk/staff/W.Langdon/FOGP Foundations of Genetic Programming]
 
{{Authority control}}
Example :-
a++
means a is an operand which is operated by a unary operator++.
it can be written in this form
a++ = a+1
 
[[Category:Functions and mappings]]
[[Category:Types of functions]]
[[Category:Unary operations|*]]