Cout prints "-0" instead of "0"
7 answers
Take a look at this article: http://en.wikipedia.org/wiki/Floating_point . Note that there is a sign bit, even if the value is zero.
+1
using namespace std; int main() { double u = 0; double w = -u; cout << w << endl; return 0; }
..."> Take a look at this article: http://en.wikipedia.org/wiki/Floating_point . Note that there is a sign bit, even if the value is zero.All geek questions in one placeCout prints "-0" instead of "0"
7 answerssource share+1