Jump to content

Unary: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
m Add link of 'address'
Line 11: Line 11:
:Increment: ++<font color=gray>x</font>, <font color=gray>x</font>++
:Increment: ++<font color=gray>x</font>, <font color=gray>x</font>++
:Decrement: --<font color=gray>x</font>, <font color=gray>x</font>--
:Decrement: --<font color=gray>x</font>, <font color=gray>x</font>--
:Address: &<font color=gray>x</font>
:[[Reference (computer science)|Address]]: &<font color=gray>x</font>
:[[Indirection]]: *<font color=gray>x</font>
:[[Indirection]]: *<font color=gray>x</font>
:Positive: +<font color=gray>x</font>
:Positive: +<font color=gray>x</font>

Revision as of 07:54, 24 May 2005

Unary may mean number system or operator:


Numeral system:


Operator: A kind of operator that has only one operand. Some examples of unary operators are listed below:

  • Math:
Factorial: n!
  • Programming language: (Notations listed below are C style.)
Increment: ++x, x++
Decrement: --x, x--
Address: &x
Indirection: *x
Positive: +x
Negative: -x
One's complement: ~x
Logical negation: !x
Sizeof: sizeof(x)
Cast: (type-name) cast-expression

See also: Arity, Operand, Operator, Unary operation, Operator (programming)

Referrence: K. & R. <<The C Programming Language>>, 2nd ed., p. 203ff.