SGN

BASin

SGN SiGN

Function

SGN indicates whether a number is positive, negative or zero.

How to use SGN

SGN is followed by a numeric value, for example

50 LET x=SGN y

An expression must be enclosed in brackets. SGN then returns 1 if the value of the argument (y above) is positive, -1 if it is negative and 0 if it is zero.

Format

  • SGN num-const
  • SGN num-var
  • SGN (num-expr)

See also

Chapter 9.