Condividi tramite


SIGN( ) Function

Returns a numeric value of 1, –1, or 0 if the specified numeric expression evaluates to a positive, negative, or 0 value.

SIGN(nExpression)

Return Values

Numeric

Parameters

  • nExpression
    Specifies the numeric expression SIGN( ) evaluates. SIGN( ) returns 1 if nExpression evaluates to a positive number, –1 if nExpression evaluates to a negative number, and 0 if nExpression evaluates to 0.

Example

STORE 10 TO gnNum1
STORE -10 TO gnNum2
STORE 0 TO gnZero
CLEAR
? SIGN(gnNum1)  && Displays 1
? SIGN(gnNum2)  && Displays -1
? SIGN(gnZero)  && Displays 0

See Also

ABS( ) | COS( ) | SIN( )