Returns 1 if number is greater than 0, or 0 if the number is 0, or -1 if the number is less than 0.
SIGN(i)
i − This the input number for which the sign needs to be determined.
Returns 1 if number is greater than 0, or 0 if the number is 0, or -1 if the number is less than 0.
/* Main program */ say SIGN(12) say SIGN(-12)
When we run the above program, we will get the following result.
1 -1