震惊到我了,很简单的一个程序,是内部逻辑问题吗?
#include<iostream> using namespace std; int main() { double temp=0; int temp2=0; temp=0.304; //temp=0.344; //0.344结果竟然越界了,不是输出的正确答案 while(temp-temp2>0){ temp*=10; temp2=int(temp);cout<<temp<<endl;} return 0; }