1.0.0 • Published 12 years ago
signum v1.0.0
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
1Install
npm install signumAPI
require("signum")(x)
Returns the sign of x
xis a number
Returns One of the following values
-1ifx<01ifx>00otherwise
Credits
(c) 2014 Mikola Lysenko. MIT License