.sign

Computes a given number’s sign. Takes input of a number \(x\) and returns:

  • 1 if \(x > 0\)
  • 0 if \(x = 0\)
  • -1 if \(x < 0\)