# Sign function (sign)

Sign of a number: -1, 0 or 1.

## How to write it

### sign(x)

**x**

A number. Takes a number.

## Examples

- $\displaystyle \operatorname{sgn}(-4) = -1$

  `sign(-4)`

  In the solver, `sign(-4)` gives `-1`.

  [Open in the solver](https://hilberon.com/?q=sign%28-4%29)

## Related functions

- [sqrt](https://hilberon.com/library/sqrt)

  Square root; sqrt(x) is the power x^(1/2).
- [round](https://hilberon.com/library/round)

  Nearest whole number, with halves rounded away from zero.
- [subtract](https://hilberon.com/library/subtract)

  A difference: the function form of -.
- [re](https://hilberon.com/library/re)

  Real part of a complex number.
- [times](https://hilberon.com/library/times)

  Product of numbers: the function form of \*.
- [quotient](https://hilberon.com/library/quotient)

  Whole-number quotient of a division, without the remainder.

---
Source: https://hilberon.com/library/sign
