title: Subtracting doubles in a while loop giving strange results
body: <p>I am getting an unexpected result and I can't figure out why. In the following Swift code I am subtracting doubles in a while loop and I am expecting the results to always be x.55 since I am only subtracting 5.00 each time, but on the last iteration the result is adding a bunch of additional numbers after the decimal and I can't figure out why. </p>
  
  <p>Can anyone point me in the right direction here? What do I need to do differently if I want the result to always be exact to two decimal places?</p>
  
  <p>Here is the example code:</p>
  
  <pre><code>var testValue1 = 5.00
  var testValue2 = 15.55
  
  while testValue2 &gt;= testValue1 {
      testValue2 = testValue2 - testValue1
      println("testValue2: \(testValue2)")
  }
  </code></pre>
  
  <p>And here is the Console output:
  testValue2: 10.55
  testValue2: 5.55
  testValue2: 0.550000000000001</p>
  
  <p>(I expected the Console output to be: 10.55, 5.55, 0.55)</p>