Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

ES6-compliant shim for Math.sign.

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
928
decreased by-78.56%
Maintainers
1
Weekly downloads
 
Created
Source

Travis status Dependency status devDependency status npm version

math-sign-x

ES6-compliant shim for Math.sign.

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

module.exports(x)number

This method returns the sign of a number, indicating whether the number is positive, negative or zero.

Kind: Exported function
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');

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 03 Sep 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