Compute Sign

Computes either a positive or negative 1, indicating the sign of a number passed into the argument. If the number argument is 0, it will return 0.

Examples in JavaScript