deneg-zero
v5.0.0
Published
Take your code from negative zero to zero in zero
Downloads
3
Maintainers
Readme
deneg-zero
Checks if an integer is negative zero, and converts to positive zero.
Install
npm install --save deneg-zero
Usage
import deneg from "deneg-zero";
deneg(-0);
//=> 0
deneg(+0);
//=> 0
deneg(12345);
//=> 12345
deneg(-4);
//=> -4
[-2, -1, -0, 0, 1, 2].map(deneg);
//=> [ -2, -1, 0, 0, 1, 2 ]
License
MIT © Philihp Busby