Inaccuracy while calculating a number with C++
<p>This is kind of a small issue but still I just want to be sure. I've read that inaccuracy is quite common problem but on the other hand my values aren't that small that there should be any inaccuracy at least I think so...</p>

<p>So the problem is that when I run the code on the other machine it causes inaccuracy which happens as early as 0.00000 digits.</p>

<p>My program calculates two different values at the same time. First value is really accurate.
Here are some example values:</p>

<p>Where to compare:</p>

<pre><code>0.01985308798     -0.8497140415
1                  0.3683436681
0.509926544       -0.2559051838
0.754963272       0.06256485518
</code></pre>

<p>Here is what my one computer produces:</p>

<pre><code>0.0198531   -0.849714
1            0.368344
0.509927    -0.255905
0.754963     0.0625649
</code></pre>

<p>And here is what happens when I'll run the program on other machine.</p>

<pre><code>0.0198531      -0.849714
1               0.368321  
0.509927       -0.255922 
0.754963        0.062544
</code></pre>

<p>After all this doesn't effect the final calculations what I'm doing but I was still wondering is there any way to fix this. My one machine is running ubuntu 32-bit and other is running 64-bit. The actual values where I'm comparing to are calculated on the 64-bit system but different program.</p>

<p>I can't really paste the code I'm sorry about that... I'll try to explain it as good as I can...  I'm doing some matrix calculations. First value is calculated by bisect function and second value is a product of a two different functions, so far as I can tell these functions has produced exactly right values while I've debugged the program on the fly on 32-bit machine. </p>

<p>If I run the example value program which generated my base values on my 32-bit desktop it will give the same values as my C++ program and the example program on 64-bit system. When I run the C++ program on the 64-bit system the inaccuracy occurs. The values that I'm using are always doubles.</p>

<p>Compilers, libraries and library confs are exactly same on the both machines.</p>

<p>Nevertheless when I'll calculate my final values there aren't that much of an inaccuracy, it happens at 0.0000 or 0.00000 and after rounding the values are quite right but not still exact the same.</p>
