Description
SIGN returns the following:
-
-1 if numeric-expression is less than zero.
-
0 (zero) if numeric-expression is zero: 0, +0, or -0.
-
1 if numeric-expression is greater than zero.
-
NULL if numeric-expression is NULL, or if it is a non-numeric string.
SIGN can be used as either an ODBC scalar function (with the curly brace syntax) or as an SQL general function.
SIGN converts numeric-expression to canonical form before determining its value. For example, SIGN(-+-+3) and SIGN(-3+5) both return 1, indicating a positive number.
Note:
In InterSystems SQL, two negative signs (hyphens) are the in-line comment indicator. For this reason, a SIGN argument specifying two successive negative signs must be presented as a numeric string enclosed in quotes.