Get number sign - Node.js Number

Node.js examples for Number:Algorithm

Description

Get number sign

Demo Code

Math.sign = function (x) {
    return (x > 0) ? 1 : ( x < 0 ? -1 : 0 );
}

Related Tutorials