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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
only 0.3/0.1 = 2 when convert to int