🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

is-negative-zero

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
i

is-negative-zero

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

2.0.3
latest
67

Supply Chain Security

100

Vulnerability

83

Quality

51

Maintenance

100

License

Socket optimized override available

Maintenance

Package can be replaced with a Socket optimized override.

Found 1 instance in 1 package

Version published
Weekly downloads
25M
15.83%
Maintainers
1
Weekly downloads
 
Created
Issues
1

What is is-negative-zero?

The is-negative-zero npm package is a utility that provides a simple function to check if a given number is -0. In JavaScript, -0 and +0 are considered distinct values (due to IEEE 754 floating point), and this package helps in identifying if a number is specifically -0.

What are is-negative-zero's main functionalities?

Check if a number is -0

This feature allows you to check if a given number is exactly -0. It returns true if the number is -0, and false otherwise. This can be particularly useful in mathematical computations and graphics programming where the distinction between -0 and +0 can have implications.

const isNegativeZero = require('is-negative-zero');

console.log(isNegativeZero(-0)); // true
console.log(isNegativeZero(0)); // false
console.log(isNegativeZero(-1)); // false

Other packages similar to is-negative-zero

FAQs

Package last updated on 19 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts