I think in the following two expressions, they have the same meaning, but the output is different. Why?
#include<iostream>
using namespace std;
#define INTEG(x) ((x)==(int)(x)?(x):((int)(x)+1))
void bugs(){
int n=10;
float p=1.1;
cout<<INTEG(n*p)<<endl;
cout<<INTEG(10*1.1)<<endl;
}
int main(){
bugs();
system("pause");
return 0;
}
Environment: visual studio 2010
Operating system: windows10
0 Answer
这家伙很懒,什么都没留下...