![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
Ohh no, it's to late already...
Of course it was redirected at my function.... My bad.
This will print the return value and its type:
msg_retval(MathMax(1ull, 2.f));I think it is called type promotion in C/C++. See https://www.mql5.com/en/docs/basis/function/functionoverload
This will print the return value and its type:
msg_retval(MathMax(1ull, 2.f));Now, I understood the problem:
But, I do not know how to solve yet
Now, I understood the problem:
But, I do not know how to solve yet
I did following test and come up to the conclusion the functions MathMin and MathMax do not follow the casting rules as documented.
This can be seen by compiling this example code and running it as proof. - I added all relevant infos alread.
At least I can now write a function signature giving the same compiler results as MathMax/MathMin....
In conclusion, these should be the valid MathMax/MathMin function signature in use by the MQL-API at the moment:
EDIT: I had to update for completnes, also including string and unsigned types now....
100 overloads for intercepting MathMix() and alike for MathMin().
Interesting!
No relation to the typecast graph.
100 overload for intercepting MathMix() and alike for MathMin().
Interesting!
No relation to the typecast graph.
Well... - Think about MathPow... it supports also matrix* and vector* but not their combination, MathPow(matrix, vector) isnt valid.... - so a template wont do the job.
I would say a more lax relation to typecasting, 5 situations will gracefully loose data by applying MathMin/MathMax...
Here is the result for MathPow, and MathMod, they behave the same, code-wise....
Interestingly there is one set thats not considered valid, but why? Accounts for both functions
float MathXXX(float, uint)
Because of limitations by the forum... here the second half