sign
sign(x)
Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.
Try it yourself:
$1 | sign(3.5)
| |
$2 | sign(-4.2)
| |
$3 | sign(0)
|
See also:
All functions