What value is returned in "res"?
On mine it prints "inf". This probably means that in MQL5 instead of throwing an error, it produces a valid mathematical value of "infinity", probably a Positive Infinity.
Oh? That I did not know? I don't use project files, so its no wonder.
Is it possible to control that with a compilation directive instead of a project file?
Actually, when I tested the OP's code I did a normal compile (not as a project), and it do not throw a zero divide either. It gave an "inf" result as reported in my previous post.
Could this be due to the latest MT5 build?
What value is returned in "res"?
On mine it prints "inf". This probably means that in MQL5 instead of throwing an error, it produces a valid mathematical value of "infinity", probably a Positive Infinity.
Yes it does prints that but I was wondering why not just throw error, display in tab and stop the program like in MT4.
In MT5 it does produce the error in tab when an integer value is used for division.
void OnStart(void) { int div = 0; double res = 10/div; Print(res); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The following script code throws zero divide error(experts tab) in MT4 but not in MT5. Is this normal behavior or a bug.