Node.js examples for Number:Algorithm
Get the sign of a number
sign = function (x) { return typeof x === 'number' ? x ? x < 0 ? -1 : 1 : x === x ? 0 : NaN : NaN; };