DEV Community

Discussion on: The Lies of "===" operator

Collapse
val_baca profile image
Valentin Baca

-0 does in fact have a sign:

en.wikipedia.org/wiki/IEEE_754

Moreover, there are two zero values, called signed zeros: the sign bit specifies whether a zero is +0 (positive zero) or −0 (negative zero).

Collapse
craigmc08 profile image
Craig McIlwrath

That same Wikipedia article specifies that 0 and -0 should compare as equal.