Travis status Dependency status devDependency status npm version ## math-sign-x Shim for Math.sign. **See**: [20.2.2.29 Math.sign(x)](http://www.ecma-international.org/ecma-262/6.0/#sec-math.sign) **Version**: 3.0.0 **Author**: Xotic750 **License**: [MIT](<https://opensource.org/licenses/MIT>) **Copyright**: Xotic750 * [math-sign-x](#module_math-sign-x) * [`.sign`](#module_math-sign-x.sign) * [`.sign2016`](#module_math-sign-x.sign2016) ⇒ number * [`.sign2018`](#module_math-sign-x.sign2018) ⇒ number ### `math-sign-x.sign` Reference to sign2018. **Kind**: static property of [math-sign-x](#module_math-sign-x) ### `math-sign-x.sign2016` ⇒ number This method returns the sign of a number, indicating whether the number is positive, negative or zero. (ES2016) **Kind**: static property of [math-sign-x](#module_math-sign-x) **Returns**: number - A number representing the sign of the given argument. If the argument is a positive number, negative number, positive zero or negative zero, the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned. | Param | Type | Description | | --- | --- | --- | | x | \* | A number. | **Example** ```js var mathSign = require('math-sign-x').sign2016; mathSign(3); // 1 mathSign(-3); // -1 mathSign('-3'); // -1 mathSign(0); // 0 mathSign(-0); // -0 mathSign(NaN); // NaN mathSign('foo'); // NaN mathSign(); // NaN ``` ### `math-sign-x.sign2018` ⇒ number This method returns the sign of a number, indicating whether the number is positive, negative or zero. (ES2018) **Kind**: static property of [math-sign-x](#module_math-sign-x) **Returns**: number - A number representing the sign of the given argument. If the argument is a positive number, negative number, positive zero or negative zero, the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned. | Param | Type | Description | | --- | --- | --- | | x | \* | A number. | **Example** ```js var mathSign = require('math-sign-x').sign2018; mathSign(3); // 1 mathSign(-3); // -1 mathSign('-3'); // -1 mathSign(0); // 0 mathSign(-0); // -0 mathSign(NaN); // NaN mathSign('foo'); // NaN mathSign(); // NaN ```