sign function

The sign function returns the sign of the specified expression, that is, zero if the argument is zero, 1 if the argument is greater than zero, and -1 if the argument is less than zero.

Syntax:

double sign(n)

Semantics:

Example 1 - sign function

SELECT sign(n) FROM PHtable
Value of n Output
1.89 1.0
-1.89 -1.0
0 0.0
sin(3*pi()/2) -1.0