In mathematics, the sign function or signum function (from signum, Latin for "sign") is a function that has the value −1, +1 or 0 according to whether the 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 sgn x {\displaystyle \operatorname {sgn} x} or sgn ( x ) {\displaystyle \operatorname {sgn}(x)} .
Definition The signum function of a real number x {\displaystyle x} is a piecewise function which is defined as follows:
sgn x := { − 1 if x < 0 , 0 if x = 0 , 1 if x > 0. {\displaystyle \operatorname {sgn} x:={\begin{cases}-1&{\text{if }}x<0,\\0&{\text{if }}x=0,\\1&{\text{if }}x>0.\end{cases}}}
The law of trichotomy states that every real number must be positive, negative or zero. The signum function denotes which unique category a number falls into by mapping it to one of the values −1, +1 or 0, which can then be used in mathematical expressions or further calculations. For example:
sgn ( 2 ) = + 1 , sgn ( π ) = + 1 , sgn ( − 8 ) = − 1 , sgn ( − 1 2 ) = − 1 , sgn ( 0 ) = 0 . {\displaystyle {\begin{array}{lcr}\operatorname {sgn}(2)&=&+1\,,\\\operatorname {sgn}(\pi )&=&+1\,,\\\operatorname {sgn}(-8)&=&-1\,,\\\operatorname {sgn}(-{\frac {1}{2}})&=&-1\,,\\\operatorname {sgn}(0)&=&0\,.\end{array}}}
Basic properties Any real number can be expressed as the product of its absolute value and its sign:
x = | x | sgn x . {\displaystyle x=|x|\operatorname {sgn} x\,.}
It follows that whenever x {\displaystyle x} is not equal to 0 we have
sgn x = x | x | = | x | x . {\displaystyle \operatorname {sgn} x={\frac {x}{|x|}}={\frac {|x|}{x}}\,.}
Similarly, for any real number x {\displaystyle x} ,
| x | = x sgn x . {\displaystyle |x|=x\operatorname {sgn} x\,.}
We can also be certain that:
sgn ( x y ) = ( sgn x ) ( sgn y ) , {\displaystyle \operatorname {sgn}(xy)=(\operatorname {sgn} x)(\operatorname {sgn} y)\,,}
and so
sgn ( x n ) = ( sgn x ) n . {\displaystyle \operatorname {sgn}(x^{n})=(\operatorname {sgn} x)^{n}\,.} From the following:
… excerpt ends here. Continue reading the full article.



