title: increment of a for loop with a decimal value
body: <p>first let me say that I've already checked related topics
  the problem is that I want to make a for loop with a decimal step size 
  I've prepared the bellow code to solve the problem, but it doesn't generate accurate number with the mentioned step size</p>
  
  <pre><code> float b;
  
  
     for ( double a=-0.2; a&lt;=0.2 ; a+=0.01)// a = landa with an increment of 0.1
  
      {
  
          b = a * 100.0;
      a = ((int)b) / 100.0;
  
  }
  </code></pre>
  
  <p>what I want is to have a accurate number in each iteration, but as the variable defined as a double thats just close to the value that it must be.(-0.20000000001,-0.19000000002,....)
  please let me know how can I solve this problem &amp; whats wrong with the code?</p>