Unary Function

From Handwiki

A unary function is a function that takes one argument. A unary operator belongs to a subset of unary functions, in that its range coincides with its domain. In contrast, a unary function's domain may or may not coincide with its range.

Examples

The successor function, denoted [math]\displaystyle{ \operatorname{succ} }[/math], is a unary operator. Its domain and codomain are the natural numbers, its definition is as follows:

[math]\displaystyle{ \begin{align} \operatorname{succ} : \quad & \mathbb{N} \rightarrow \mathbb{N} \\ & n \mapsto (n + 1) \end{align} }[/math]

In many programming languages such as C, executing this operation is denoted by postfixing [math]\displaystyle{ \mathrel{+{+}} }[/math] to the operand, i.e. the use of [math]\displaystyle{ n\mathrel{+{+}} }[/math] is equivalent to executing the assignment [math]\displaystyle{ n:= \operatorname{succ}(n) }[/math].

Many of the elementary functions are unary functions, including the trigonometric functions, logarithm with a specified base, exponentiation to a particular power or base, and hyperbolic functions.

See also

  • Arity
  • Binary function
  • Binary operator
  • List of mathematical functions
  • Ternary operation
  • Unary operation

References

  • Foundations of Genetic Programming



Retrieved from "https://handwiki.org/wiki/index.php?title=Unary_function&oldid=2634643"

Categories: [Functions and mappings] [Types of functions] [Unary operations]


Download as ZWI file | Last modified: 09/21/2023 04:50:22 | 12 views
☰ Source: https://handwiki.org/wiki/Unary_function | License: CC BY-SA 3.0

ZWI signed:
  Encycloreader by the Knowledge Standards Foundation (KSF) ✓[what is this?]