math-sign-x

WebJar for math-sign-x

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

math-sign-x
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

math-sign-x
WebJar for math-sign-x
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Xotic750/math-sign-x

Download math-sign-x

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/math-sign-x/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>math-sign-x</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/math-sign-x/
implementation 'org.webjars.npm:math-sign-x:3.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/math-sign-x/
implementation ("org.webjars.npm:math-sign-x:3.0.0")
'org.webjars.npm:math-sign-x:jar:3.0.0'
<dependency org="org.webjars.npm" name="math-sign-x" rev="3.0.0">
  <artifact name="math-sign-x" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='math-sign-x', version='3.0.0')
)
libraryDependencies += "org.webjars.npm" % "math-sign-x" % "3.0.0"
[org.webjars.npm/math-sign-x "3.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : is-nan-x jar [1.0.1,2)
org.webjars.npm : to-number-x jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

math-sign-x

Shim for Math.sign.

module.exports(x)*

math-sign-xnumber

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

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.

Param Type Description
x * A number.

Example

import mathSign from 'math-sign-x';

console.log(mathSign(3)); //  1
console.log(mathSign(-3)); // -1
console.log(mathSign('-3')); // -1
console.log(mathSign(0)); //  0
console.log(mathSign(-0)); // -0
console.log(mathSign(NaN)); // NaN
console.log(mathSign('foo')); // NaN
console.log(mathSign()); // NaN

Versions

Version
3.0.0