Question: Consider the following C++ code:

```
double someZero = 0;
std::cout << 0 - someZero << '\n';   // prints 0
std::cout << -someZero << std::endl; // prints -0

```

The question arises: what is negative zero good for, and should it be defensively avoided (i.e. use subtraction instead of smacking a minus onto a variable)?

Answer: 
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](https://people.freebsd.org/~das/kahan86branch.pdf).

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`.
Negative zero has for example some use when handling complex numbers...

In everyday use one should mostly avoid the negative zero.

Some links with information regarding background/uses/pitfalls of "negative zero":  

* <http://en.wikipedia.org/wiki/Signed_zero>
* <http://en.wikipedia.org/wiki/Floating_point#Signed_zero>
* <http://en.wikipedia.org/wiki/Branch_cut>
* <http://connect.microsoft.com/VisualStudio/feedback/details/344366/negative-zero-behavior-between-c-and-c-code-is-different>
* <http://connect.microsoft.com/VisualStudio/feedback/details/292276/in-vs2005-c-zero-reported-as-negative-zero-for-double-type>
* [C++ ceil and negative zero](https://stackoverflow.com/questions/5986875/c-ceil-and-negative-zero)