Wonder if there are any nontrivial ways of finding number\'s sign (signum function)? May be shorter / faster / more elegant solutions than the obvious one
Math.sign is not supported on IE 11. I am combining the best answer with Math.sign answer :
Math.sign = Math.sign || function(number){ var sign = number ? ( (number <0) ? -1 : 1) : 0; return sign; };
Now, one can use Math.sign directly.