SIGN
Description
The SIGN function is used to determine the sign of a given numeric expression expr. Based on the value of expr, the function returns the following results:
- When
expris positive, it returns 1.0; - When
expris negative, it returns -1.0; - When
expris 0, it returns 0.
Syntax
Parameters
expr: The numerical expression to determine the sign, of typeDOUBLE.
Return Value
Returns a result of type DOUBLE, which is 1.0, -1.0, or 0 depending on the sign of expr.
Example Usage
The following example demonstrates how to use the SIGN function to determine the sign of different numbers:
Notes
- When
exprisNULL, theSIGNfunction will returnNULL.
