Unary operation

In mathematics, a unary operation is an operation with only one operand. For instance, logical negation is a unary operation on truth values and squaring is a unary operation on the real numbers. Another unary operation is the factorial, n!. A unary operation on the set S is nothing but a function SS.

Unary operator are also used in programming languages. For example in the C++ programming language, the following operators are unary:

See also

See also: Unary operation, Arity, Binary operation, C Plus Plus, Factorial, Function (mathematics), Indirection, Logical negation, Mathematics, Negation