JavaScript Editor js editor     Web development 



Main Page

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

SIGN(nExpression)

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.

Return Value

Numeric

Example

В Copy Code
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



JavaScript Editor js editor     Web development