SIGN¶
Description¶
SIGN returns the sign of a number as an integer: -1 if the number is negative, 0 if it is zero, and 1 if it is positive.
Syntax¶
Returns: -1, 0, or 1.
Example¶
This returns -1.
This returns 0.
This returns 1.
Example in context¶
Returns -1 if the balance is negative, 0 if it is exactly zero, and 1 if it is positive. Useful for conditional logic without writing a full if/case expression.