is-negative-zero (2.0.3)

Published 2026-02-24 13:58:29 +00:00 by atheaadmin

Installation

registry=
npm install is-negative-zero@2.0.3
"is-negative-zero": "2.0.3"

About this package

is-negative-zero Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value negative zero? === will lie to you.

Example

var isNegativeZero = require('is-negative-zero');
var assert = require('assert');

assert.notOk(isNegativeZero(undefined));
assert.notOk(isNegativeZero(null));
assert.notOk(isNegativeZero(false));
assert.notOk(isNegativeZero(true));
assert.notOk(isNegativeZero(0));
assert.notOk(isNegativeZero(42));
assert.notOk(isNegativeZero(Infinity));
assert.notOk(isNegativeZero(-Infinity));
assert.notOk(isNegativeZero(NaN));
assert.notOk(isNegativeZero('foo'));
assert.notOk(isNegativeZero(function () {}));
assert.notOk(isNegativeZero([]));
assert.notOk(isNegativeZero({}));

assert.ok(isNegativeZero(-0));

Tests

Simply clone the repo, npm install, and run npm test

Dependencies

Development Dependencies

ID Version
@ljharb/eslint-config ^21.1.0
@types/tape ^5.6.4
aud ^2.0.4
auto-changelog ^2.4.0
eslint =8.8.0
in-publish ^2.0.1
npmignore ^0.3.1
nyc ^10.3.2
safe-publish-latest ^2.0.0
tape ^5.7.5
typescript next

Keywords

is negative zero negative zero number positive 0 -0
Details
npm
2026-02-24 13:58:29 +00:00
0
Jordan Harband
MIT
latest
9.2 KiB
Assets (1)
Versions (1) View all
2.0.3 2026-02-24