Features of the mql5 language, subtleties and tricks - page 242

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
an old feature of Min/Max in MQL - they work the way the developers think, i.e. correctly :-)
it's the standards that are wrong.
ahhh..., then why was it so confusing about " Mathematically the same expression (highlighted) " and union
was enough:
but since 0.0 == -0.0, then I can't imagine a situation where this could be a problem and, in fact, affect anything at all
If it wasn't zero, then it would be a problem. And at zero it doesn't affect anything.
For:
c++ - What is the difference between -0 and 0? - Stack Overflow
So, all you need to know is that 0 = -0
That's the whole feature that doesn't affect calculations and logic
I have an excellent understanding of the question, so I wrote both versions of MathMin to show that mathematically identical functions in programming languages produce different results.
It seems to be a bug.
It works fine in C++:
in the console:
Long negative zero = 0
Question in passing to the developers. Is it normal that in the debugging window the Union variable does not expand and does not react at all to a click?
The fields Union.Num1 and Union.Num2 were added manually. At least this way you can see the values...
Works as expected! The first bit (bit index 0) is the sign bit which is set for -0.0.
These are also more special cases in ieee 754 format. https://www. wikiwand.com/en/IEEE%20754#Special_values
It seems to be a bug.
It works fine in C++:
in the console:
there is no bug. In C++ it is the same.
you just made a mistake with formatting and type
try this:
In the same context, this can examine the 64 bit representation of doubles https://www.mql5.com/en/code/20822
or the shorter version
there is no bug. It is the same in C++.
just made a mistake with formatting and type
try this:
Yes, I was in a hurry. Thanks for the science ))
Sometimes you need to quickly put an EA into the Tester. You can do it like this.
Select a date in the future and press CTRL+F5 in ME.