Skip to content

SGN

Category: Function
Syntax: SGN(expression)

Description

Returns the sign of the evaluated expression: -1 if the expression is negative, 0 if it is zero, and 1 if positive.

See also

Example

10 PRINT(SGN(-4.5))
20 PRINT(SGN(0))
30 PRINT(SGN(9.2))