Uses for negative zero floating point value?

From Wikipedia:

It is claimed that the inclusion of signed zero in IEEE 754 makes it much easier to achieve numerical accuracy in some critical problems[1], in particular when computing with complex elementary functions[2].

The first reference is “Branch Cuts for Complex Elementary Functions or Much Ado About Nothing’s Sign Bit” by W. Kahan, that is available for download here.

One example from that paper is 1/(+0) vs 1/(-0). Here, the sign of zero makes a huge difference, since the first expression equals +inf and the second, -inf.

Leave a Comment