SGN() Function - Decimal Sign

Syntax

SGN(num{,ERR=lineref})

Description

The SGN() function returns a 1, 0, or -1 depending on whether its numeric argument is positive, zero, or negative respectively.

Examples

>PRINT SGN(100)
1
>PRINT SGN(0)
0
>PRINT SGN(-100)
-1

See Also

Functions - Alphabetical Listing