int main() { float fa = 1.111; if( fa > -0.000001 && fa < 0.000001) //小数点后五个0 { std::cout << "equals 0" << endl; } else { std::cout << "is not 0" << endl; } return 0; }
Float与0值的比较
原文:http://www.cnblogs.com/tylerhuang/p/4926456.html