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`.
In addition 
Signed Zero Good For :

The zeroes can be considered as a variant of the extended real number line such that 1/−0 = −∞ and 1/+0 = +∞, division by zero is only undefined for ±0/±0.

Negatively signed zero echoes the mathematical analysis concept of approaching 0 from below as a one-sided limit, which may be denoted by x → 0−, x → 0−, or x → ↑0. The notation "−0" may be used informally to denote a small negative number that has been rounded to zero. The concept of negative zero also has some theoretical applications in statistical mechanics and other disciplines