![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Added a new function for comparing doubles:
Faster.
Faster.
Ugly!
Sure, it is faster but in interpreted languages like JavaScript, but not in MQL. See https://stackoverflow.com/a/48764436.
Sure, it is faster but in interpreted languages like JavaScript, but not in MQL. See https://stackoverflow.com/a/48764436.
You need to learn how to make proper performance measurements.
21 times faster.
@fxsaber Yes, you are right, I forgot that the expression got optimized out, coz its value was not used.
However, mine takes 0.04 microsec per call. Do you think it worth this micro-optimization over readability?!!
The percentage saved over a whole program = percentage function is called * percentage saved by optimization.
Surely, the 1st term of the equation is always way too small for this specific function. That is why profiling your program is sometimes more important to see the whole picture, rather than timing a single instruction.
Thanks for passing by. :-)However, mine takes 0.04 microsec per call. Do you think it worth this micro-optimization over readability?!!
In this case, I am definitely on the performance side. Readability is very easy for me.
In this case, I am definitely on the performance side. Readability is very easy for me.
I'm sure you are. take care.
It seems to me that such a modification of the condition is correct.