29 ms·
It's a natural consequence of the IEEE 754 standard for floating point numbers.
by lliamander 3y ago
It's a natural consequence of the IEEE 754 standard for floating point numbers.
- Tuna-Fish 3y agoTo be clear, it was added to the standard because there was user demand for it. Zero is already special cased in IEEE 754 (along with the rest of the denormals, because of the implied leading mantissa bit), the implementation would be no harder if you just only had a single zero. However, back when the standard was being created, when a single zero value was proposed there was pushback from people in the user community who depended on knowing which side of the zero they underflowed on their own floating point implementations. Many people think that negative zero is just an engineering artefact. This is not true, it is a feature that was asked for, debated, and then added... ... almost certainly because it was an engineering artefact in a previous system that someone managed to depend on, https://xkcd.com/1172/ https://xkcd.com/1172/ style.
- munk-a 3y ago> Many people think that negative zero is just an engineering artefact. This is not true, it is a feature that was asked for, debated, and then added... Allowing zero to be represented with two bit patterns was a feature that was advocated for to make bit operations easier - it was not decided that both zeroes should be distinguishable. This absolutely is an engineering artifact but you're quite correct that it was quite intentional.
- kragen 3y agoi think the rationale in https://people.freebsd.org/~das/kahan86branch.pdf https://people.freebsd.org/~das/kahan86branch.pdf goes well above and beyond 'an engineering artefact in a previous system that someone managed to depend on'
- kragen 3y agounfortunately this scan is missing some pages