Product SiteDocumentation Site

7.4.57. SIGN


>>-SIGN(number)------------------------------------------------><

Returns a number that indicates the sign of number. The number is first rounded according to standard Rexx rules, as though the operation number+0 had been carried out. It returns -1 if number is less than 0, 0 if it is 0, and 1 if it is greater than 0.
Here are some examples:

Example 7.71. Builtin function SIGN

SIGN("12.3")       ->     1
SIGN(" -0.307")    ->    -1
SIGN(0.0)          ->     0