Sgn Function [Runtime] /text/sbasic/shared/03080701.xhp Sun Microsystems, Inc. converted from old format - fpe
Sgn function Sgn Function [Runtime] Returns an integer number between -1 and 1 that indicates if the number that is passed to the function is positive, negative, or zero.
Syntax: Sgn (Number) Return value: Integer Parameters: Number: Numeric expression that determines the value that is returned by the function. NumExpression Return value negative Sgn returns -1. 0 Sgn returns 0. positive Sgn returns 1.
Example: Sub ExampleSgn Print sgn(-10) REM returns -1 Print sgn(0) REM returns 0 Print sgn(10) REM returns 1 end sub