# What does sgn mean?

I am reading "space filling curve" by Hans Sagan. On page 17, on equation (2.3.11) in the equation, a function sgn is used.

What is sgn?

To put it into context, in the book it says $h_n=$sgn$(n)[(n-1)+i]$

• It is a slightly abbreviated form of "sign" as in positive or negative. en.wikipedia.org/wiki/Sign_function Jun 8 '16 at 17:23
• The reason for abbreviation is a little clearer when calling it the signum function. Jun 8 '16 at 18:40

Typically, $\operatorname{sgn}$ stands for the sign function $$\operatorname{sgn}(x) = \begin{cases} 1 & x > 0 \\ 0 & x = 0 \\ -1 & x < 0 \end{cases}.$$

• NB the definitions of $\mathop{\rm sgn}(0)$ vary between $0$ and $1$. If $0$ is a plausible argument, you should assure yourself of the definition of $\mathop{\rm sgn}$ at $0$ in your context. Jun 8 '16 at 19:54
• @AlexR Actually, they vary between three options: (a) $\operatorname{sgn}0=0$; (b) $\operatorname{sgn}0=1$; (c) $\operatorname{sgn}0$ is undefined, i.e., $\operatorname{Dom}\operatorname{sgn} = \mathbb{R}\setminus\{0\}$. I'm in favor of (a) and I consder (b) a deadly sin.
– yo'
Jun 8 '16 at 21:43
• When $\text{sgn}(x)$ is used for applications (e.g., robust statistics), it is most commonly asserted that $\text{sgn}(0) = 0$ (as far as I know). Jun 8 '16 at 22:10
• @yo, I guess it depends on whether or not the relationship between the sign function and the unit step function needs to be maintained, among other things. Jun 9 '16 at 1:12
• @J.M. There is of course also a simple relationship with the unit step function $H(x)$ ($H$ stands for Heaviside) to the symmetric $\operatorname{sgn}$ function: $\operatorname{sgn}x=H(x)-H(-x)$. The relation you are alluding to with the asymmetric sign function is $\operatorname{sgn}^+x=2H(x)-1$. Jun 9 '16 at 5:10

I will expand on Dominik's answer.

$\operatorname{sgn}$, standing for "sign", is usually defined as,

$$\operatorname{sgn}(x) = \begin{cases} 1 & x > 0 \\ 0 & x = 0 \\ -1 & x < 0 \end{cases}.$$

but not always. Some use

$$\operatorname{sgn}(x) = \begin{cases} 1 & x > 0 \\ 0 & x < 0 \end{cases}.$$

(that is, $\operatorname{sgn}(0)$ is undefined).

In rare cases, one might define $\operatorname{sgn}(0)$ as one or zero, for convinience. It really depends on the situation and usecase.