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 (mathematics) S → S .
Unary operators are also used in programming languages. For example in the C plus plus programming language, the following operators are unary:
*Increment: ++x, x++ *Decrement: --x, x-- *Reference (computer science): &x *Indirection: *x *Positive: +x *Negative: -x *Signed number representations: ~x *Negation: !x *Sizeof: sizeof(x) *Type conversion: ( type-name ) cast-expression
=See also=
|
|