sign()
returns the signum of the given number: 0 if the number is 0, -1 for any negative number, and 1 for any positive number.
Syntax: sign(expression)
Returns: An Integer.
Arguments
Name | Description |
expression | A numeric expression. |
Example
RETURN sign(1.3)
The value return the signum of 1.3, which will be 1.
Considerations
sign(null)
returnsnull
.
Example
RETURN sign(-1.7)
Returns the following Result
sign(-1.7) |
-1 |
Example
RETURN sign(0)
Returns the following Result
sign(0) |
0 |
Example
RETURN sign(7.0)
Returns the following Result
sign(7.0) |
1 |
Example
RETURN sign(null)
Returns the following Result
sign(null) |
null |
Note– sign(null)
returns null
.