title: Why does adding 0.01 in a while loop print weird numbers?
body: <p>So I created a while x &lt;= 10 add 0.01 but it outputs numbers to 4dp and so on and lowers the endings too.</p>
  
  <pre class="lang-py prettyprint-override"><code>x = 0
  c = 0 #count of numbers
  while x &lt;= 10:
      x += 0.01
      c += 1
      print (x)
  print(c)
  </code></pre>
  
  <p>Expected results to be
  0.01, 0.02, 0.03
  Results seem to become changed at 0.06</p>
  
  <p>0.01
  0.02
  0.03
  0.04
  0.05
  0.060000000000000005
  0.07
  0.08
  0.09
  0.09999999999999999
  MIDDLE STUFF
  9.959999999999832
  9.969999999999832
  9.979999999999832
  9.989999999999831
  9.999999999999831
  10.009999999999831</p>