I was trying out a simple arithmetic on console where I tried to multiply 0 with -1. Interestingly, I got a -0 as answer, instead of 0.
Screenshot:
Can anyone explain these results?
Under the IEEE standard.
Signed zero is zero with an associated sign. In ordinary arithmetic, −0 = +0 = 0. However, in computing, some number representations allow for the existence of two zeros, often denoted by −0 (negative zero) and +0 (positive zero). This occurs in some signed number representations for integers, and in most floating point number representations. The number 0 is usually encoded as +0, but can be represented by either +0 or −0.
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