What my easy code 's error,two value compare

 
Look last Code ,why the run ruzult is  ok2    not  ok3?
  double a=4.0;
      double    b=4.5;
      if(a>b)  Alert("ok1");
      if(a<b)  Alert("ok2");
      if(a==b) Alert("ok3");



 double a=4.0;
      int b=4;
      if(a>b)  Alert("ok1");
      if(a<b)  Alert("ok2");
      if(a==b) Alert("ok3");






           int MAINX= FileOpen("MAIN2222.TXT", FILE_COMMON|FILE_CSV|FILE_READ|FILE_WRITE);
           FileWrite(MAINX,4);  
           FileSeek(MAINX, 0, SEEK_SET);
           FileClose(MAINX);
//That's mean is write  a text  and write integer 4

   
           int MAINX= FileOpen("MAIN2222.TXT", FILE_COMMON|FILE_CSV|FILE_READ|FILE_WRITE);
           FileSeek(MAINX,0,SEEK_SET);
           double a=FileReadNumber(MAINX);  //这里的方向只代表了美元的多头方向
           FileClose(MAINX);
      //Read the double  a=4
           int b=4;
        
      
          if(a>b)  Alert("ok1");
          if(a<b) Alert("ok2");
         if(a==b) Alert("ok3"); 
Look last Code ,why the run result sometimes is  ok2    not  ok3? WHY

            
 
Print() the result and see what is the value for a.
 
zdj231: ,why the run ruzult is  ok2    not  ok3?
The == operand. - MQL4 forum
Reason: