sgn()
Returns the sign of a numeric expression.
Syntax:
variable
= sgn(
number
)
Returns 1 if
number
is positive, -1 if it's negative and 0 if it's zero.
Example:
print
sgn(
8.21
)
print
sgn(
-5
)
print
sgn(
0
)
it will print on console 1, -1, 0