Sign Function

The sign function gives −1 for any negative real number, 0 for zero, or +1 for any positive real number.

Piecewise formula of sign function: -1 if x is less than 0, 0 if x equals 0, 1 if x is greater than 0

It is written:

f(x) = sign(x)

or

f(x) = sgn(x)

This is its graph:

Graph of the sign function showing flat horizontal lines at y=-1 and y=1, with open circles on the y-axis, and a solid point at (0,0)
The Sign Function

Note the circles on the graph!

  • The solid dot at (0, 0) means that when x is exactly 0, the function value is exactly 0
  • The open circles at (0, 1) and (0, −1) show that those endpoints are not included. For example, if x is slightly positive (like 0.001), the value is 1, but at exactly 0, it jumps to 0

Connection to Absolute Value

For any number other than zero, we can use the absolute value function and write the sign function as:

sgn(x) = x|x|

Let's try it:

Other

It is an odd function.

Plot the graph here.