RTFM https://book.mql4.com/basics/expressions
then the value of 7 / 3 for the expression X / Y and variable Z is equal to 2 (two).
5/2 is an int not 2.5 (a double.) You wrote:double ResultOf=2;
Trydouble ResultOf=(5+0.)/2; // Float the 5, then float the 2, then divide. double ResultOf=5/2.; // Float the 5 to be compatible with the 2., then divide. double ResultOf=5./2; // Float the 2 to be compatible with the 5., then divide. double tmp=5; double ResultOf=tmp/2; double ResultOf=5; ResultOf /= 2; double ResultOf=Double(5)/2; double Double(double a){ return(a); }
Alright... Now thats what I call "Showing Em How It's Done". :)
WHRoeder:
RTFM https://book.mql4.com/basics/expressions5/2 is an int not 2.5 (a double.) You wrote:
Try
RTFM https://book.mql4.com/basics/expressions5/2 is an int not 2.5 (a double.) You wrote:
Try
Now is working..
You are a genius...
Thank you.
This thing gave me a headache previously. Had to comment out each formula output to discover it was the divisions doing that. But I found a way around it.
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
I don't know why, but when i was making an indicator, i can't obtain a correct division.
Is this bug or is missing me something??
Example: