In mathematics, 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 , is a unary operator. Its domain and codomain are the natural numbers; its definition is as follows:

Unary function

In many programming languages such as C, executing this operation is denoted by postfixing to the operand, i.e. the use of is equivalent to executing the assignment .

Unary function

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.

Unary function

See also

Arity

Binary function

Binary operator

List of mathematical functions

Ternary operation

Unary operation

References

Foundations of Genetic Programming

Functions and mappings

Types of functions