Android Math Calculation Not Giving Expected Value
<p>I'm trying to run a calculation but I'm not getting the correct result and struggling to understand why.</p>

<p><strong>Calculation</strong></p>

<pre><code>float Signal = ((20 - 0) / (20 - 4)) * (F5 - 4) + 0;
</code></pre>

<p><code>F5</code> = 12 and is declared as a "Float" type</p>

<p>When run through a calculator, you end up with the following:</p>

<ol>
<li>((20 - 0) / (20 - 4)) * (12 - 4) + 0</li>
<li>((20) / (16)) * (12 - 4) + 0</li>
<li>(1.25) * (8) + 0</li>
<li>Result = 10</li>
</ol>

<p>However, when this is run through the Android code, I get the result of 8.</p>

<p>Why is this, I'd like to understand what's going on</p>