Sign Function | |
Returns a numeric value of 1, –1, or 0 if the specified numeric expression evaluates to a positive, negative, or 0 value.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax FUNCTION Sign(
nExpression AS USUAL
) AS LONG
public static int Sign(
Usual nExpression
)
Request Example
View SourceParameters
- nExpression
- Type: Usual
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
Type:
Long
Numeric
Examples 1STORE 10 TO gnNum1
2STORE -10 TO gnNum2
3STORE 0 TO gnZero
4CLEAR
5? Sign(gnNum1)
6? Sign(gnNum2)
7? Sign(gnZero)
See Also