#include <iostream> using namespace std; int main() { double u = 0; double w = -u; cout << w << endl; return 0; }
为什么这个伟大的代码输出-0而不是0像人们期望的那样?
-0
0
c++ floating-point
c++ ×1
floating-point ×1