Numerical concepts

Negative zero

Try the free JavaScript compiler

Number has signed zeros. Strict equality equates them, while Object.is distinguishes them. Dividing a positive finite nonzero Number by -0 yields negative infinity. JSON serialization of negative zero loses its sign.

Formal Syntax & Structure

javascript syntaxjavascript
-0

Working Example

Example Snippetjavascript
console.log(Object.is(-0,0),1/(-0));
JavaScript Reference