Home

Unary

Unary describes a relation or operation involving a single operand. The term comes from the Latin unus meaning “one.” In mathematics, logic, and computer science, unary is used to distinguish things that act on one input from those with two inputs (binary) or more.

In mathematics, a unary operation maps a single element to another. Examples include negation, which sends x

The unary numeral system, or base-1 representation, expresses a number by a count of a single symbol,

In computing, a unary operator applies to exactly one operand. Common examples include unary plus and unary

In logic and theoretical computer science, a unary predicate or unary function has arity one, meaning it

Overall, unary emphasizes the single-input nature of a function, operation, or relation across disciplines.

---

to
-x,
and
the
identity
function,
which
leaves
x
unchanged.
The
unary
minus
is
used
to
indicate
additive
inverses,
while
other
one-argument
functions
such
as
absolute
value
or
certain
trigonometric
values
are
also
unary
in
function,
though
they
may
be
composed
with
other
operations.
In
theory,
a
unary
function
is
one
with
arity
1.
usually
a
tally
mark
or
repeated
ones.
It
is
non-positional
and
impractical
for
everyday
arithmetic,
but
it
serves
as
a
simple
model
in
theoretical
computer
science
and
combinatorics.
minus,
which
indicate
sign;
logical
negation,
denoted
by
not
or
!;
and
bitwise
negation,
often
written
~.
Many
languages
also
implement
unary
increment
and
decrement
operators
(such
as
++
and
--)
that
modify
a
single
operand.
These
operators
illustrate
the
concept
of
arity
in
programming
language
design.
takes
a
single
argument.
In
linguistics
and
computer
science,
unary
branching
or
unary
structures
describe
constructions
with
a
single
immediate
constituent.