Syntax :
Sgn ( numExpression )
numExpression : Numeric expression for which you want to determine the sign.
Sgn ( numExpression )
numExpression : Numeric expression for which you want to determine the sign.
intSign1 = Sgn ( 100 )
This example sets the variable intSign1 to 1 , indicating that the numExpression evaluated was positive.
intSign2 = Sgn ( 0 )
This example sets the variable intSign2 to 0 , indicating that the numExpression evaluated was 0.
intSign3 = Sgn ( -100 )
This example sets the variable intSign3 to -1 , indicating that the numExpression evaluated was negative.
This example sets the variable intSign1 to 1 , indicating that the numExpression evaluated was positive.
intSign2 = Sgn ( 0 )
This example sets the variable intSign2 to 0 , indicating that the numExpression evaluated was 0.
intSign3 = Sgn ( -100 )
This example sets the variable intSign3 to -1 , indicating that the numExpression evaluated was negative.
No comments:
Post a Comment