Float subtraction returns incorrect value
<p>So I have a calculation whereby two floats that are components of vector objects are subtracted and then seem to return an incorrect result.</p>

<p>The code I'm attempting to use is:</p>

<pre><code>cout &lt;&lt; xresult.x &lt;&lt; " " &lt;&lt; vec1.x &lt;&lt; endl;
float xpart1 = xresult.x - vec1.x;
cout &lt;&lt; xpart1 &lt;&lt; endl;
</code></pre>

<p>Where running this code will return</p>

<pre><code>16 17
-1.00002
</code></pre>

<p>As you can see, printing out the values of xresult.x and vec1.x tells you that they are 16 and 17 respectively, yet the subtraction operation seems to introduce an error.</p>

<p>Any ideas why?</p>
