I am curious as to, even 0 === -0
, but 1/0
and 1/-0
give different results. So we can probably assume that 0
and -0
are represented differently in IEEE 754. How are they represented?
Update: so far, I can find some info on https://en.wikipedia.org/wiki/Signed_zero
and it seems that there are IEEE 754-1985 and IEEE 754-2008, and one form might be, in binary:
0 00000000 00000000000000000000000 as positive 0
1 00000000 00000000000000000000000 as negative 0
(the above is 32 bit, with the left most bit the sign bit, then to the right, 8 bit as exponent, and then 23 bit as the significand). But I can't find the different between the 1985 and 2008 version.
-0
but didn't find anything. I don't think for the fact that something can be found on the Internet or Wikipedia, it can't be a question on SO – nonopolarity