The < operator does not produce desired results

 
double electron_double = 0.01;
double atom_double = 0.00;
   
bool atom_false = false;
bool atom_true = true;
int j = 0;
string roots_signed[] = {"M1","M5","M15","M30","M60","M240","M1440"};

while(atom_double < 50.01){
  for(int i = 0; i < ArraySize(roots_signed); i++){
    memory[j].name = roots_signed[i] + "_" + DoubleToString(atom_double, 2);
    memory[j].weight = 1;
    j++;
  } 
  Print("Init Memory; " + (j - 1) + ", Object; " + memory[j - 1].name);
  atom_double += electron_double; 
}
Hi MQL% Community. I have a problem with the attached code, can you help me figure out whats wrong with it. When i run it, it creates to the memory array objects concatenated with "50.01", but that should not happen.
MQL5.community - User Memo
MQL5.community - User Memo
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.
Files:
code.txt  1 kb
 
52092985:
atom_double += electron_double

You are falling for an issue, every new coder encounters one day.... - You are not understanding floating point data type.

Please read and understand this:

https://en.wikipedia.org/wiki/IEEE_754

 
Learn to use the debugger to find out why and where you code is wrong:
https://www.metatrader5.com/en/metaeditor/help/development/debug
Code debugging - Developing programs - MetaEditor Help
  • www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...
 
Dominik Christian Egert #:

You are falling for an issue, every new coder encounters one day.... - You are not understanding floating point data type.

Please read and understand this:

https://en.wikipedia.org/wiki/IEEE_754

Ok i understand, thank you. I knew it was the floating point type i just didnt know how and what to search for. I will convert the number to integers and deal with them that way. 
 
Carl Schreiber #:
Learn to use the debugger to find out why and where you code is wrong:
https://www.metatrader5.com/en/metaeditor/help/development/debug
I have never learnt how to use the debugger, i guess i have to learn. Thank you.
Reason: