According to what I've read, all numbers in JavaScript are saved as floats except array indexes and the operands of bitwise operations.
Because all floats have a sign bit -0 === 0
should evaluate to false. However it evaluates to true.
Because JS uses the IEEE 754 standard for floating point numbers, which states that -0
and +0
should "compare as equal with the usual (numerical) comparison operators." (source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With