The sign of a number x is defined to be -1 if x < 0, to be 0 if x = 0 and to be 1 if x > 0. Write a definition of function sign(x), which yields the sign of x. Use cases.

Test it by pushing the Compute button. After it works, submit it by pushing the Submit button.

 

  [Language: Cinnameg  Kind: function definition]