title: C# Improving CPU Speed in Division, by specifying # of Decimal Places
body: <p>This is about optimizing CPU speed. I'm looking for nanosecond gains.</p>
  
  <p>Basic setup:</p>
  
  <pre><code>double Result;
  Result = (double) 1 / 3;
  </code></pre>
  
  <p>This gives "0.333333333333333". What I'm looking for is only 4 significant decimal places without doing the entire division. So, rounding after the division makes no difference. The CPU should stop working on the problem the moment he has arrived at the 4th decimal place.</p>
  
  <p>Is this an improvement?</p>
  
  <pre><code>int Num = (int) 1 * 10000 / 3;
  double Result = Num / (double) 10000;
  </code></pre>
  
  <p>or simply</p>
  
  <pre><code>double Result = (int)(1*10000/3)/(double)10000
  </code></pre>
  
  <p>Is this faster? even with the additional multiplication by 10000? </p>
  
  <p>I was hoping the Math method had something like Math.Divide(numerator,denominator,significantDecimalPlaces). Any recommendations?</p>