Sgn

sgn returns the sign (-1, 0 or +1) of a numeric value.

Syntax

 sgn(EXP_NUM)

Examples

 CUBIC_ROOT = sgn(X) * abs(X) ^ (1/3)

Description

sgn(X) returns:
* +1 if X is strictly positive.
* 0 if X is zero.
* -1 if X is strictly negative.

The type of result is Integer.

Associated errors

Error codeDescription
10The argument is not numeric.

See also

abs.