scijs / signum

Returns the sign of a number
MIT License
2 stars 0 forks source link

signum

Returns the sign of a floating point number

Example

var sgn = require("signum")

console.log(sgn(-0.00001))
console.log(sng(0))
console.log(sng(Infinity))

Output:

-1
0
1

Install

npm install signum

API

require("signum")(x)

Returns the sign of x

Returns One of the following values

Credits

(c) 2014 Mikola Lysenko. MIT License