title: Why is the 100*0.07 equal to 6.9999....?
body: <p>One of my friends wrote the following in Matlab and the outputs are little weird: </p>
  
  <pre><code>for p=0.01:0.01:0.1
  100*p 
  end
  </code></pre>
  
  <p>The following was the output: </p>
  
  <pre><code>1
  2
  3
  4 
  5
  6.000000000000001
  6.999999999999999
  8
  9
  10
  </code></pre>
  
  <p>I'd like to know why there is a slight error? Does this mean that, the accuracy in the general case is also as poor as it is in this case?</p>
  
  <p>EDIT:</p>
  
  <p>We compared the numbers -- <code>7==6.999999999999999</code> and the output was <code>0</code>. So, Matlab contradicts itself! </p>