On MT4 v434, division quotient don't give floating point values(Bug??)

 

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:

double ResultOf=5/2;

// Should give the Result of 2.5, however in comment i have 2.
// Anyone knows why?? or is one more Bug??

 
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;
Try
double 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

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.
Reason: