Good observation - this one was interesting.
The divide operator is the highest priority operator in your if statement, so zero divide is generated before the relational operators are even considered.
More information here:
https://docs.mql4.com/basis/operations/rules
Cheers,
Raider
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
{
//----
//will got a zero divide ! It should check the first expression then return false.
int a=0;
if(a>0 && 100/a>10)
{
Alert("ok");
}//----
return(0);
}