title: How to resolve a Java Rounding Double issue
body: <p>Seems like the subtraction is triggering some kind of issue and the resulting value is wrong.</p>
  
  <pre><code>double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d;
  </code></pre>
  
  <p>78.75 = 787.5 * 10.0/100d</p>
  
  <pre><code>double netToCompany = targetPremium.doubleValue() - tempCommission;
  </code></pre>
  
  <p>708.75 = 787.5 - 78.75</p>
  
  <pre><code>double dCommission = request.getPremium().doubleValue() - netToCompany;
  </code></pre>
  
  <p>877.8499999999999 = 1586.6 - 708.75</p>
  
  <p>The resulting expected value would be 877.85.</p>
  
  <p>What should be done to ensure the correct calculation?</p>