Rexx - SIGN



Returns 1 if number is greater than 0, or 0 if the number is 0, or -1 if the number is less than 0.

Syntax

SIGN(i) 

Parameters

  • i − This the input number for which the sign needs to be determined.

Return Value

Returns 1 if number is greater than 0, or 0 if the number is 0, or -1 if the number is less than 0.

Example

/* Main program */ 
say SIGN(12) 
say SIGN(-12) 

When we run the above program, we will get the following result.

Output

1 
-1 
rexx_numbers.htm
Advertisements