double x1=0.3;
double x2=0.1*3;
cout<<(x1==x2)<<endl;
double y1=0.75;
double y2=0.1*7.5;
cout<<(y1==y2)<<endl;
system("pause");
The output is 0 and 1. I want to know the reason behind it.
double x1=0.3;
double x2=0.1*3;
cout<<(x1==x2)<<endl;
double y1=0.75;
double y2=0.1*7.5;
cout<<(y1==y2)<<endl;
system("pause");
The output is 0 and 1. I want to know the reason behind it.