Home

signum

Signum, also called the sign function, is a mathematical function that extracts the sign of a real number. It maps a real input to -1, 0, or 1, depending on whether the input is negative, zero, or positive.

For real numbers, sgn(x) = -1 if x < 0, sgn(x) = 0 if x = 0, and sgn(x) = 1

Properties include that the sign function is odd: sgn(-x) = -sgn(x), and it is discontinuous at 0, being

In calculus, the derivative of sgn(x) is 0 for x ≠ 0 and is not defined at x

Origin and usage: the term signum comes from Latin signum, meaning sign or mark. In programming and

if
x
>
0.
Equivalently,
sgn(x)
=
x/|x|
for
x
≠
0,
with
sgn(0)
defined
as
0
by
convention.
The
sign
function
can
be
extended
to
complex
numbers
by
sgn(z)
=
z/|z|
for
z
≠
0,
and
sgn(0)
=
0;
in
the
complex
case
the
result
has
magnitude
1
for
nonzero
inputs.
piecewise
constant
elsewhere.
It
relates
to
the
absolute
value
via
|x|
=
sgn(x)
·
x.
It
can
also
be
expressed
in
terms
of
the
Heaviside
step
function
H
by
sgn(x)
=
2H(x)
−
1
for
x
≠
0,
with
a
chosen
convention
at
x
=
0.
=
0;
in
the
theory
of
distributions,
the
derivative
of
sgn
is
2δ,
where
δ
is
the
Dirac
delta
distribution.
Applications
of
the
signum
function
appear
in
piecewise
definitions,
numerical
algorithms,
control
theory,
signal
processing,
and
as
a
simple
non-smooth
tool
in
analysis.
software,
signum
routines
return
the
sign
of
a
number,
and
in
mathematics
it
serves
as
a
foundational
non-smooth
function
for
building
more
complex
constructs.