Problem on calculating a number

Hello, I met a problem in FreeFEM++ on calculating a integer number, which can be simplified as the following problem. I defined a integer M in the following two ways, and I expected that they give me the same number 2. However, I got M1 = 1 and M2 = 2 from the output. Why would this occur? Can anyone help me with this problem? Thanks!

int M1 = 20*(1.0-0.9);
int M2 = 20*0.1;
cout << "M1: " << M1 << ", M2: " << M2 << endl;

The problem is due to basic represation of floating number
and 0.9 au 0.1 have no exact repression in base 2
so you have roundoff error and you see that here
I compute

int M1 = 20*(1.0-0.9);
int M2 = 20*0.1;
cout << "M1: " << M1 << ", M2: " << M2 << " " << 20*(1.0-0.9)-2 << endl;

and the get

M1: 1, M2: 2 -4.44089e-16