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]$


Solution 1:

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

Solution 2:

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.