Socket
Socket
Sign inDemoInstall

math-sign-x

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

math-sign-x

Shim for Math.sign.


Version published
Maintainers
1
Created
Source

Travis status Dependency status devDependency status npm version

math-sign-x

Shim for Math.sign.

See: 20.2.2.29 Math.sign(x)
Version: 3.0.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750

math-sign-x.sign

Reference to sign2018.

Kind: static property of math-sign-x

math-sign-x.sign2016number

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
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.

ParamTypeDescription
x*A number.

Example

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.sign2018number

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
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.

ParamTypeDescription
x*A number.

Example

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

Keywords

FAQs

Package last updated on 18 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc