Consider the following C++ code:
double someZero = 0;
std::cout << 0 - someZero << '
'; // 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)?
See Question&Answers more detail:os