SIGN

The SIGN function returns the sign of the specified number.

Syntax

SIGN ( number )

number

A  DOUBLE PRECISION number that specifies the value whose sign you want.

Results

The data type of the returned value is INTEGER:.

  • If the specified number is NULL, the result of this function is NULL.
  • If the specified number is zero (0), the result of this function is zero (0).
  • If the specified number is greater than zero (0), the result of this function is plus one (+1).
  • If the specified number is less than zero (0), the result of this function is minus one (-1).

Example

splice> VALUES( SIGN(84.4), SIGN(-85.5), SIGN(0), SIGN(NULL) );
1          |2          |3          |4
-----------------------------------------------
1          |-1         |0          |NULL

1 row selected

See Also