signum(X)
Returns the sign number (-1, 0, or 1) of a given value. (Available as of version 15.20)
Syntax
signum(X)
Input
| Argument | Type | Description |
|---|---|---|
X |
any numeric type | A numeric value |
Return Value
Returns the sign number of X. Possible return values are -1 for any negative
numeric type, 0 for a value of 0, or 1 for any positive numeric
type.
If X is N/A, the result is N/A.
Sample Usage
X |
signum(X) |
|---|---|
| 149.45 | 1 |
| 149 | 1 |
| -149.4 | -1 |
| 0 | 0 |
| NA | NA |
