SGN

n = SGN (x)

Sign of x. Return values are +1 for positive x, -1 for negative x and 0 for zero. SGN cannot accept a numeric string, such as “24”, as an argument.

Example

PRINT SGN(2), SGN(-2), SGN(0)  ' Output is:   1 -1  0
PRINT SGN(INT("-2"))           ' Output is:  -1
Math
If there is insufficient information on this page and you wish learn more about SGN, please send an email to smallbasic@gmail.com. You can help to improve information about SGN by submitting a pull request, click View Source for details. Note, an offline language reference text file is also available - see the Download section.