HP 3000 Manuals

SGN [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

SGN 

The SGN function evaluates the sign of a number.  It returns the
following value:

  -1 if n is negative.
  0 if n is zero.
  1 if n is positive.

Syntax 

SGN(n)

Parameters 

n                The number that is to be evaluated.  This can be of any
                 numeric type.

Examples 

     10 A = SGN(-239)    !A = -1
     20 B = SGN(9-(3*3)) !B = 0
     30 C = SGN(78.8)    !C = 1



MPE/iX 5.0 Documentation