<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Sign_function</id>
	<title>Sign function - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Sign_function"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Sign_function&amp;action=history"/>
	<updated>2026-04-09T23:10:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=Sign_function&amp;diff=310996&amp;oldid=prev</id>
		<title>imported&gt;ZDC0530: /* growthexperiments-addlink-summary-summary:2|1|0 */</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Sign_function&amp;diff=310996&amp;oldid=prev"/>
		<updated>2025-09-20T22:33:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;growthexperiments-addlink-summary-summary:2|1|0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Function returning minus 1, zero or plus 1}}&lt;br /&gt;
{{Redirect|Sgn||SGN (disambiguation)}}&lt;br /&gt;
{{distinguish|Sign relation|Sine function}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Signum function.svg|thumb|Signum function &amp;lt;math&amp;gt;y = \sgn x&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
In [[mathematics]], the &amp;#039;&amp;#039;&amp;#039;sign function&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;signum function&amp;#039;&amp;#039;&amp;#039; (from &amp;#039;&amp;#039;[[wikt:signum#Latin|signum]]&amp;#039;&amp;#039;, [[Latin language|Latin]] for &amp;quot;sign&amp;quot;) is a [[Function (mathematics)|function]] that has the value {{math|&amp;amp;minus;1}}, {{math|+1}} or {{math|0}} according to whether the [[Sign (mathematics)|sign]] of a given [[real number]] is positive or negative, or the given number is itself zero. In [[mathematical notation]] the sign function is often represented as &amp;lt;math&amp;gt;\sgn x&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;\sgn (x)&amp;lt;/math&amp;gt;.&amp;lt;ref name=&amp;quot;:0&amp;quot;&amp;gt;{{Cite web|title=Signum function - Maeckes|url=http://www.maeckes.nl/Signum%20functie%20GB.html|access-date=|website=www.maeckes.nl}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Definition==&lt;br /&gt;
The signum function of a real number &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is a [[piecewise]] function which is defined as follows:&amp;lt;ref name=&amp;quot;:0&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \sgn x :=\begin{cases} &lt;br /&gt;
-1 &amp;amp; \text{if } x &amp;lt; 0, \\&lt;br /&gt;
0 &amp;amp; \text{if } x = 0, \\&lt;br /&gt;
1 &amp;amp; \text{if } x &amp;gt; 0. \end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[law of trichotomy]] states that every real number must be positive, negative or zero.&lt;br /&gt;
The signum function denotes which unique category a number falls into by mapping it to one of the values {{math|&amp;amp;minus;1}}, {{math|+1}} or {{math|0,}} which can then be used in mathematical expressions or further calculations.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\begin{array}{lcr}&lt;br /&gt;
\sgn(2) &amp;amp;=&amp;amp; +1\,, \\&lt;br /&gt;
\sgn(\pi) &amp;amp;=&amp;amp; +1\,, \\&lt;br /&gt;
\sgn(-8) &amp;amp;=&amp;amp; -1\,, \\&lt;br /&gt;
\sgn(-\frac{1}{2}) &amp;amp;=&amp;amp; -1\,, \\&lt;br /&gt;
\sgn(0) &amp;amp;=&amp;amp; 0\,.&lt;br /&gt;
\end{array}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Basic properties ==&lt;br /&gt;
Any real number can be expressed as the product of its [[absolute value]] and its sign:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; x = |x| \sgn x\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It follows that whenever &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is not equal to 0 we have&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \sgn x = \frac{x}{|x|} = \frac{|x|}{x}\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly, for &amp;#039;&amp;#039;any&amp;#039;&amp;#039; real number &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;,&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; |x| = x\sgn x\,. &amp;lt;/math&amp;gt;&lt;br /&gt;
We can also be certain that:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn (xy)=(\sgn x)(\sgn y)\,,&amp;lt;/math&amp;gt;&lt;br /&gt;
and so&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn (x^n)=(\sgn x)^n\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Some algebraic identities ==&lt;br /&gt;
The signum can also be written using the [[Iverson bracket]] notation:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn x = -[x &amp;lt; 0] + [x &amp;gt; 0] \,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The signum can also be written using the [[Floor and ceiling functions|floor]] and the absolute value functions:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn x = \Biggl\lfloor \frac{x}{|x|+1} \Biggr\rfloor - &lt;br /&gt;
\Biggl\lfloor \frac{-x}{|x|+1} \Biggr\rfloor \,.&amp;lt;/math&amp;gt;&lt;br /&gt;
If &amp;lt;math&amp;gt;0^0&amp;lt;/math&amp;gt; is accepted to be equal to 1, the signum can also be written for all real numbers as &lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn x = 0^ \left ( - x + \left\vert x \right\vert  \right ) - 0^ \left ( x + \left\vert x \right\vert  \right ) \,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Properties in mathematical analysis ==&lt;br /&gt;
&lt;br /&gt;
=== Discontinuity at zero ===&lt;br /&gt;
[[File:Discontinuity of the sign function at 0.svg|thumb|300px|The sign function is not [[continuous function | continuous]] at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Although the sign function takes the value {{math|&amp;amp;minus;1}} when &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is negative, the ringed point {{math|(0, &amp;amp;minus;1)}} in the plot of &amp;lt;math&amp;gt;\sgn x&amp;lt;/math&amp;gt; indicates that this is not the case when &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;. Instead, the value jumps abruptly to the solid point at {{math|(0, 0)}} where &amp;lt;math&amp;gt;\sgn(0)=0&amp;lt;/math&amp;gt;. There is then a similar jump to &amp;lt;math&amp;gt;\sgn(x)=+1&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is positive. Either jump demonstrates visually that the sign function &amp;lt;math&amp;gt;\sgn x&amp;lt;/math&amp;gt; is discontinuous at zero, even though it is continuous at any point where &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is either positive or negative.&lt;br /&gt;
&lt;br /&gt;
These observations are confirmed by any of the various equivalent formal definitions of [[Continuous function|continuity]] in [[mathematical analysis]]. A function &amp;lt;math&amp;gt;f(x)&amp;lt;/math&amp;gt;, such as &amp;lt;math&amp;gt;\sgn(x),&amp;lt;/math&amp;gt; is continuous at a point &amp;lt;math&amp;gt;x=a&amp;lt;/math&amp;gt; if the value &amp;lt;math&amp;gt;f(a)&amp;lt;/math&amp;gt; can be approximated arbitrarily closely by the [[sequence]] of values &amp;lt;math&amp;gt;f(a_1),f(a_2),f(a_3),\dots,&amp;lt;/math&amp;gt; where the &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; make up any infinite sequence which becomes arbitrarily close to &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; becomes sufficiently large. In the notation of mathematical [[Limit of a sequence|limit]]s, continuity of &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; requires that &amp;lt;math&amp;gt;f(a_n) \to f(a)&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;n \to \infty&amp;lt;/math&amp;gt; for any sequence &amp;lt;math&amp;gt;\left(a_n\right)_{n=1}^\infty&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;a_n \to a.&amp;lt;/math&amp;gt; The arrow symbol can be read to mean &amp;#039;&amp;#039;approaches&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;tends to&amp;#039;&amp;#039;, and it applies to the sequence as a whole.&lt;br /&gt;
&lt;br /&gt;
This criterion fails for the sign function at &amp;lt;math&amp;gt;a=0&amp;lt;/math&amp;gt;. For example, we can choose &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; to be the sequence &amp;lt;math&amp;gt;1,\tfrac{1}{2},\tfrac{1}{3},\tfrac{1}{4},\dots,&amp;lt;/math&amp;gt; which tends towards zero as &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; increases towards infinity. In this case, &amp;lt;math&amp;gt;a_n \to a&amp;lt;/math&amp;gt; as required, but &amp;lt;math&amp;gt;\sgn(a)=0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sgn(a_n)=+1&amp;lt;/math&amp;gt; for each &amp;lt;math&amp;gt;n,&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;\sgn(a_n) \to 1 \neq \sgn(a)&amp;lt;/math&amp;gt;. This counterexample confirms more formally the discontinuity of &amp;lt;math&amp;gt;\sgn x&amp;lt;/math&amp;gt; at zero that is visible in the plot.&lt;br /&gt;
&lt;br /&gt;
Despite the sign function having a very simple form, the step change at zero causes difficulties for traditional [[calculus]] techniques, which are quite stringent in their requirements. Continuity is a frequent constraint. One solution can be to approximate the sign function by a smooth continuous function; others might involve less stringent approaches that build on classical methods to accommodate larger classes of function.&lt;br /&gt;
&lt;br /&gt;
=== Smooth approximations and limits ===&lt;br /&gt;
The signum function can be given as a number of different (pointwise) limits:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\begin{align}&lt;br /&gt;
\sgn x &amp;amp;= \lim_{n\to\infty}\frac{1-2^{-nx}}{1+2^{-nx}}\\&lt;br /&gt;
       &amp;amp;= \lim_{n\to\infty}\frac{2}{\pi}\operatorname{arctan}(nx)\\&lt;br /&gt;
       &amp;amp;= \lim_{n\to\infty}\tanh(nx)\\&lt;br /&gt;
       &amp;amp;= \lim_{\varepsilon\to 0} \frac{x}{\sqrt{x^2 + \varepsilon^2}}.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
Here, &amp;lt;math&amp;gt;\tanh&amp;lt;/math&amp;gt; is the [[hyperbolic tangent]], and &amp;lt;math&amp;gt;\operatorname{arctan}&amp;lt;/math&amp;gt; is the [[arctan|inverse tangent]].  The last of these is the derivative of &amp;lt;math&amp;gt;\sqrt{x^2+\varepsilon ^2}&amp;lt;/math&amp;gt;. This is inspired from the fact that the above is exactly equal for all nonzero &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; if &amp;lt;math&amp;gt;\varepsilon=0&amp;lt;/math&amp;gt;, and has the advantage of simple generalization to higher-dimensional analogues of the sign function (for example, the partial derivatives of &amp;lt;math&amp;gt;\sqrt{x^2+y^2}&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
See &amp;#039;&amp;#039;{{section link|Heaviside step function#Analytic approximations}}&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Differentiation ===&lt;br /&gt;
&lt;br /&gt;
The signum function &amp;lt;math&amp;gt;\sgn x&amp;lt;/math&amp;gt; is [[Differentiable function|differentiable]] everywhere except when &amp;lt;math&amp;gt;x=0.&amp;lt;/math&amp;gt; Its [[derivative]] is zero when &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; is non-zero:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \frac{\text{d}\, (\sgn x)}{\text{d}x} = 0 \qquad \text{for } x \ne 0\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This follows from the differentiability of any [[constant function]], for which the derivative is always zero on its domain of definition. The signum &amp;lt;math&amp;gt;\sgn x&amp;lt;/math&amp;gt; acts as a constant function when it is restricted to the negative [[Interval (mathematics)#Definitions and terminology|open region]] &amp;lt;math&amp;gt;x&amp;lt;0,&amp;lt;/math&amp;gt; where it equals {{math|−1}}. It can similarly be regarded as a constant function within the positive open region &amp;lt;math&amp;gt;x&amp;gt;0,&amp;lt;/math&amp;gt; where the corresponding constant is {{math|+1}}. Although these are two different constant functions, their derivative is equal to zero in each case.&lt;br /&gt;
&lt;br /&gt;
It is not possible to define a classical derivative at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;, because there is a discontinuity there.&lt;br /&gt;
&lt;br /&gt;
Although it is not differentiable at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt; in the ordinary sense, under the generalized notion of differentiation in [[distribution (mathematics)|distribution theory]], &lt;br /&gt;
the derivative of the signum function is two times the [[Dirac delta function]]. This can be demonstrated using the identity &amp;lt;ref&amp;gt;{{MathWorld |title=Sign |id=Sign}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \sgn x = 2 H(x) - 1 \,,&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;H(x)&amp;lt;/math&amp;gt; is the [[Heaviside step function]] using the standard &amp;lt;math&amp;gt;H(0)=\frac{1}{2}&amp;lt;/math&amp;gt; formalism.&lt;br /&gt;
Using this identity, it is easy to derive the distributional derivative:&amp;lt;ref&amp;gt;{{MathWorld |title=Heaviside Step Function |id=HeavisideStepFunction}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \frac{\text{d}\sgn x}{\text{d}x} = 2 \frac{\text{d} H(x)}{\text{d}x} = 2\delta(x) \,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Integration ===&lt;br /&gt;
&lt;br /&gt;
The signum function has a [[definite integral]] between any pair of finite values {{mvar|a}} and {{mvar|b}}, even when the interval of integration includes zero. The resulting integral for {{mvar|a}} and {{mvar|b}} is then equal to the difference between their absolute values:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \int_a^b (\sgn x) \, \text{d}x = |b| - |a| \,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In fact, the signum function is the derivative of the absolute value function, except where there is an abrupt change in [[slope|gradient]] at zero:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt; \frac{\text{d} |x|}{\text{d}x} =  \sgn x \qquad \text{for } x \ne 0\,.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can understand this as before by considering the definition of the absolute value &amp;lt;math&amp;gt;|x|&amp;lt;/math&amp;gt; on the separate regions &amp;lt;math&amp;gt;x&amp;gt;0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x&amp;lt;0.&amp;lt;/math&amp;gt; For example, the absolute value function is identical to &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; in the region &amp;lt;math&amp;gt;x&amp;gt;0,&amp;lt;/math&amp;gt; whose derivative is the constant value {{math|+1}}, which equals the value of &amp;lt;math&amp;gt;\sgn x&amp;lt;/math&amp;gt; there.&lt;br /&gt;
&lt;br /&gt;
Because the absolute value is a [[convex function]], there is at least one [[subderivative]] at every point, including at the origin. Everywhere except zero, the resulting [[subdifferential]] consists of a single value, equal to the value of the sign function. In contrast, there are many subderivatives at zero, with just one of them taking the value &amp;lt;math&amp;gt;\sgn(0) = 0&amp;lt;/math&amp;gt;. A subderivative value {{math|0}} occurs here because the absolute value function is at a minimum. The full family of valid subderivatives at zero constitutes the subdifferential interval &amp;lt;math&amp;gt;[-1,1]&amp;lt;/math&amp;gt;, which might be thought of informally as &amp;quot;filling in&amp;quot; the graph of the sign function with a vertical line through the origin, making it continuous as a two dimensional curve.&lt;br /&gt;
&lt;br /&gt;
In integration theory, the signum function is a [[weak derivative]] of the absolute value function. Weak derivatives are equivalent if they are equal [[almost everywhere]], making them impervious to isolated anomalies at a single point. This includes the change in gradient of the absolute value function at zero, which prohibits there being a classical derivative.&lt;br /&gt;
&lt;br /&gt;
=== Fourier transform ===&lt;br /&gt;
The [[Fourier transform]] of the signum function is&amp;lt;ref&amp;gt;{{cite journal|last1=Burrows|first1=B. L.|last2=Colwell|first2=D. J.|title=The Fourier transform of the unit step function|journal=International Journal of Mathematical Education in Science and Technology|date=1990|volume=21|issue=4|pages=629–635|doi=10.1080/0020739900210418}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;PV\int_{-\infty}^\infty (\sgn x) e^{-ikx}\text{d}x = \frac{2}{ik} \qquad \text{for } k \ne 0,&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;PV&amp;lt;/math&amp;gt; means taking the [[Cauchy principal value]].&lt;br /&gt;
&lt;br /&gt;
== Generalizations ==&lt;br /&gt;
&lt;br /&gt;
=== Complex signum ===&lt;br /&gt;
&amp;lt;!-- [[Complex sign function]] and [[Complex signum function]] redirect here --&amp;gt;&lt;br /&gt;
The signum function can be generalized to [[complex numbers]] as:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn z = \frac{z}{|z|} &amp;lt;/math&amp;gt;&lt;br /&gt;
for any complex number &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; except &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt;. The signum of a given complex number &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; is the [[point (geometry)|point]] on the [[unit circle]] of the [[complex plane]] that is nearest to &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;.  Then, for &amp;lt;math&amp;gt;z\ne 0&amp;lt;/math&amp;gt;,&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn z = e^{i\arg z}\,,&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\arg&amp;lt;/math&amp;gt; is the [[Argument (complex analysis)|complex argument function]].&lt;br /&gt;
&lt;br /&gt;
For reasons of symmetry, and to keep this a proper generalization of the signum function on the reals, also in the complex domain one usually defines, for &amp;lt;math&amp;gt;z=0&amp;lt;/math&amp;gt;: &lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sgn(0+0i)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another generalization of the sign function for real and complex expressions is &amp;lt;math&amp;gt;\text{csgn}&amp;lt;/math&amp;gt;,&amp;lt;ref&amp;gt;Maple V documentation. May 21, 1998&amp;lt;/ref&amp;gt; which is defined as:&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;&lt;br /&gt;
 \operatorname{csgn} z= \begin{cases}&lt;br /&gt;
 1 &amp;amp; \text{if } \mathrm{Re}(z) &amp;gt; 0, \\&lt;br /&gt;
 -1 &amp;amp; \text{if } \mathrm{Re}(z) &amp;lt; 0, \\&lt;br /&gt;
 \sgn \mathrm{Im}(z) &amp;amp; \text{if } \mathrm{Re}(z) = 0&lt;br /&gt;
\end{cases}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\text{Re}(z)&amp;lt;/math&amp;gt; is the real part of &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\text{Im}(z)&amp;lt;/math&amp;gt; is the imaginary part of &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We then have (for &amp;lt;math&amp;gt;z\ne 0&amp;lt;/math&amp;gt;):&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\operatorname{csgn} z = \frac{z}{\sqrt{z^2}} = \frac{\sqrt{z^2}}{z}. &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Polar decomposition of matrices ===&lt;br /&gt;
&amp;lt;!-- Was &amp;quot;Generalization to matrices&amp;quot; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thanks to the [[Polar decomposition]] theorem, a matrix &amp;lt;math&amp;gt;\boldsymbol A\in\mathbb K^{n\times n}&amp;lt;/math&amp;gt; (&amp;lt;math&amp;gt;n\in\mathbb N&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbb K\in\{\mathbb R,\mathbb C\}&amp;lt;/math&amp;gt;) can be decomposed as a product &amp;lt;math&amp;gt;\boldsymbol Q\boldsymbol P&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\boldsymbol Q&amp;lt;/math&amp;gt; is a [[unitary matrix]] and &amp;lt;math&amp;gt;\boldsymbol P&amp;lt;/math&amp;gt; is a self-adjoint, or Hermitian, positive definite matrix, both in &amp;lt;math&amp;gt;\mathbb K^{n\times n}&amp;lt;/math&amp;gt;. If  &amp;lt;math&amp;gt;\boldsymbol A&amp;lt;/math&amp;gt; is invertible then such a decomposition is unique and  &amp;lt;math&amp;gt;\boldsymbol Q&amp;lt;/math&amp;gt; plays the role of &amp;lt;math&amp;gt;\boldsymbol A&amp;lt;/math&amp;gt;&amp;#039;s signum. A dual construction is given by the decomposition &amp;lt;math&amp;gt;\boldsymbol A=\boldsymbol S\boldsymbol R&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\boldsymbol R&amp;lt;/math&amp;gt; is unitary, but generally different than &amp;lt;math&amp;gt;\boldsymbol Q&amp;lt;/math&amp;gt;. This leads to each [[invertible matrix]] having a unique left-signum &amp;lt;math&amp;gt;\boldsymbol Q&amp;lt;/math&amp;gt; and right-signum &amp;lt;math&amp;gt;\boldsymbol R&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the special case where &amp;lt;math&amp;gt;\mathbb K=\mathbb R,\ n=2,&amp;lt;/math&amp;gt; and the (invertible) matrix &amp;lt;math&amp;gt;\boldsymbol A = \left[\begin{array}{rr}a&amp;amp;-b\\b&amp;amp;a\end{array}\right]&amp;lt;/math&amp;gt;, which identifies with the (nonzero) complex number &amp;lt;math&amp;gt;a+\mathrm i b=c&amp;lt;/math&amp;gt;, then the signum matrices satisfy &amp;lt;math&amp;gt;\boldsymbol Q=\boldsymbol P=\left[\begin{array}{rr}a&amp;amp;-b\\b&amp;amp;a\end{array}\right]/|c|&amp;lt;/math&amp;gt; and identify with the complex signum of &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sgn c = c/|c|&amp;lt;/math&amp;gt;.  In this sense, polar decomposition generalizes to matrices the signum-modulus decomposition of complex numbers.&lt;br /&gt;
&lt;br /&gt;
=== Signum as a generalized function ===&lt;br /&gt;
&amp;lt;!-- Was &amp;quot;Generalized signum function&amp;quot; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At real values of &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, it is possible to define a [[generalized function]]&amp;amp;ndash;version of the signum function, &amp;lt;math&amp;gt;\varepsilon (x)&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;\varepsilon (x)^2=1&amp;lt;/math&amp;gt; everywhere, including at the point &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;, unlike &amp;lt;math&amp;gt;\sgn&amp;lt;/math&amp;gt;, for which &amp;lt;math&amp;gt;(\sgn 0)^2=0&amp;lt;/math&amp;gt;. This generalized signum allows construction of the [[algebra of generalized functions]], but the price of such generalization is the loss of [[commutativity]]. In particular, the generalized signum anticommutes with the Dirac delta function&amp;lt;ref name=&amp;quot;Algebra&amp;quot;&amp;gt;&lt;br /&gt;
{{cite journal&lt;br /&gt;
 |author  = Yu.M.Shirokov&lt;br /&gt;
 |title   = Algebra of one-dimensional generalized functions&lt;br /&gt;
 |journal = [[Theoretical and Mathematical Physics]]&lt;br /&gt;
 |year    = 1979&lt;br /&gt;
 |volume  = 39&lt;br /&gt;
 |issue   = 3&lt;br /&gt;
 |pages   = 471–477&lt;br /&gt;
 |url     = http://springerlink.metapress.com/content/w3010821x8267824/?p=5bb23f98d846495c808e0a2e642b983a&amp;amp;pi=3&lt;br /&gt;
 |archive-url = https://archive.today/20121208232109/http://springerlink.metapress.com/content/w3010821x8267824/?p=5bb23f98d846495c808e0a2e642b983a&amp;amp;pi=3&lt;br /&gt;
 |url-status = dead&lt;br /&gt;
 |archive-date = 2012-12-08&lt;br /&gt;
 |doi     = 10.1007/BF01017992&lt;br /&gt;
|bibcode = 1979TMP....39..471S&lt;br /&gt;
 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\varepsilon (x) \delta(x)+\delta(x) \varepsilon(x) = 0 \, ;&amp;lt;/math&amp;gt;&lt;br /&gt;
in addition, &amp;lt;math&amp;gt;\varepsilon (x)&amp;lt;/math&amp;gt; cannot be evaluated at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;; and the special name, &amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is necessary to distinguish it from the function &amp;lt;math&amp;gt;\sgn&amp;lt;/math&amp;gt;. (&amp;lt;math&amp;gt;\varepsilon (0)&amp;lt;/math&amp;gt; is not defined, but &amp;lt;math&amp;gt;\sgn 0=0&amp;lt;/math&amp;gt;.)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Absolute value]]&lt;br /&gt;
* [[Heaviside step function]]&lt;br /&gt;
* [[Negative number]]&lt;br /&gt;
* [[Rectangular function]]&lt;br /&gt;
* [[Sigmoid function]] ([[Hard sigmoid]])&lt;br /&gt;
* [[Step function]] ([[Piecewise constant function]])&lt;br /&gt;
* [[Three-way comparison]]&lt;br /&gt;
* [[Zero crossing]]&lt;br /&gt;
* [[Polar decomposition]]&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Sign Function}}&lt;br /&gt;
[[Category:Special functions]]&lt;br /&gt;
[[Category:Unary operations]]&lt;/div&gt;</summary>
		<author><name>imported&gt;ZDC0530</name></author>
	</entry>
</feed>