signum
Syntax
signum(X)
Alias: sign
Arguments
x is a scalar/vector/matrix of numeric or Boolean value.
Details
Return 1 if X is positive; 0 if X is 0; -1 if X is negative; NULL if X is NULL.
Examples
signum 1 0 -1 NULL;
// output
[1,0,-1, ]
signum(X)
Alias: sign
x is a scalar/vector/matrix of numeric or Boolean value.
Return 1 if X is positive; 0 if X is 0; -1 if X is negative; NULL if X is NULL.
signum 1 0 -1 NULL;
// output
[1,0,-1, ]