Sgn Function
Determines the sign of the operand.
Syntax
Sgn(Operand )
Parameters
- Operand
- Specify a numeric value.
Return Values
- 1: If the operand is a positive value.
- 0: If the operand is a 0
- -1: If the operand is a negative value.
Description
The Sgn function determines the sign of the numeric value of the operand.
See Also
Abs Function, And Operator, Atan Function, Atan2 Function, Cos Function, Int Function, Mod Operator, Or Operator, Not Operator, Sin Function, Sqr Function, Str$ Function, Tan Function, Val Function, Xor Operator
Sgn Function Example
This is a simple command window example on the usage of the Sgn function.
>print sgn(123)
1
>print sgn(-123)
-1
>