You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
##Description
The sign function is used to determine whether a number is positive, zero or negative. It returns 1 if r > 0, 0 if r = 0, and -1 if r < 0. For example, sign (5) is 1 and sign (-23) is -1.
##Example
This program reads in numbers and determines if they are positive, zero or negative:
var x : real
get x
case sign ( x ) of
label 1 : put "Positive"
label 0 : put "Zero"
label -1 : put "Negative"
end case