SGN

Function

SGN returns the value of the sign of the argument.

Syntax

SGN(N)

where N is a numeric expression.

Examples

A = SGN (-9.5)

sets A equal to -1

A = SGN(0)

sets A equal to 0

A = SGN(1.76E9)

sets A equal to 1

Remarks

Result:

  • 1 if Positive
  • 0 if Zero
  • -1 if Negative