I found similar topics on Forum, but they sounded not quite same as my case, and decided to post this one.
I have following source code.
double SpanA_Buffer, SpanB_Buffer;
//These arrays are re-sized and also initialized as follow.
if (SpanA_Buffer == SpanB_Buffer) Print("Passed if (SpanA_Buffer == SpanB_Buffer)");
Here is extracts from log file.
*** Successful case ***
SpanA_Buffer = 0.8911 SpanB_Buffer = 0.8911
Passed if (SpanA_Buffer == SpanB_Buffer
*** Failing case ***
SpanA_Buffer = 0.8968 SpanB_Buffer = 0.8968
I tried NormalizeDouble, but these values above do not really require to be rounded.
Moreover, when I tested with this function, values were rounded, and I couldn't get desirable result.
Majority of the comparison actually failed.
If someone could give me any advice, it would be much appreciated.
Thank you very much for your quick response.
I read through "working with doubles in MQL4" earlier, and checked and tested with some functions.
Now, I just changed the location of NormalizeDouble, from the section where I calculate values to the section where I actually assign the calculated result to the array.
Then result was very much improved!
Thank you for your help. Much appreciated.
Yep. I read that, too, and I was not using the function in that case.
And, it was really good that your msg pushed me to read these information through once again, and I could think of a few other things I could give a try. ;)