title: Pascal double value is not exact, how to fix this?
body: <p>I have been solving a programming challenge in UVA and got this problem, which is REALLY strange. Here is the flawed code:</p>
  
  <pre><code>program WTF;
  begin
    WriteLn(Trunc(2.01 * 100));
    ReadLn();
  end.
  </code></pre>
  
  <p>Obviously, I need to get <code>201</code> as <code>Integer</code>, but I get <code>200</code>, this happens because Double somehow doesn't store the exact value... It's <code>2.01 = 2.00(9)</code> for reasons unbeknownst to me, can someone explain this and provide a solution?</p>
  
  <p>Edit: Yet, I figgured that using <code>Round()</code> instead of <code>Trunc()</code> fixes this... But still, why wouldn't <code>Trunc()</code> work?</p>