Writing a signum function

How do I represent a signum function using the latex provided in this site

$$\displaystyle \mathop{\mathrm{sign}}(x)=\displaystyle \left\{ \begin {array}{ll} -1 & \mbox{when}\,\, x<0, \\ 0 & \mbox{when}\,\, x=0,\\ 1 & \mbox{when}\,\, x>0. \\ \end{array} \right.$$

Back to top