mt5 bug when rounding

 
   Print( "0.3/0.1 : ", 0.3/0.1); //3
   Print( "(int)(0.3/0.1) : " ,(int)(0.3/0.1));//2
   Print( "(int)(3.0) : ",(int)(3.0));//3
   
   Print( "0.4/0.1 : ", 0.4/0.1); // 4
   Print( "(int)(0.4/0.1) : " ,(int)(0.4/0.1)); // 4
   Print( "(int)(4.0) : ",(int)(4.0));  //  4


only 0.3/0.1 = 2 when convert to int

 

Everything is correct: if 2.9999999 is cast to the 'int' type, it will be 2

   double zero_one=0.1,zero_three=0.3,zero_four=0.4,three=3.0,four=4.0;
   double a=zero_three/zero_one;
   int b=(int)a;
   Print("0.3/0.1 : ", zero_three/zero_one);  //3
   Print("(int)(0.3/0.1) : ",(int)(zero_three/zero_one));  //2
   Print("(int)(3.0) : ",(int)(3.0)); //3
   Print("0.4/0.1 : ", zero_four/zero_one);  // 4
   Print("(int)(0.4/0.1) : ",(int)(zero_four/zero_one));   // 4
   Print("(int)(4.0) : ",(int)(four));   //  4


Files:
Script_1.mq5  3 kb