1.0.0 • Published 8 years ago

is-zero v1.0.0

Weekly downloads
246
License
MIT
Repository
github
Last release
8 years ago

is-zero

Build Status NPM Version License

is ±0 ?

Installation

$ npm install is-zero

API

  • is0.isZero(x: number): boolean
  • is0.isPositiveZero(x: number): boolean
  • is0.isNegativeZero(x: number): boolean

Example

var is0 = require("is-zero");

console.log(is0.isZero(+0)); // => true
console.log(is0.isZero(-0)); // => true
console.log(is0.isPositiveZero(+0)); // => true
console.log(is0.isPositiveZero(-0)); // => false
console.log(is0.isNegativeZero(+0)); // => false
console.log(is0.isNegativeZero(-0)); // => true

License

MIT