Dividing two integer without casting to double
<p>I have two integer variables, <code>partial</code> and <code>total</code>. It is a progress, so <code>partial</code> starts at zero and goes up one-by-one to the value of <code>total</code>.</p>

<p>If I want to get a fraction value indicating the progress(from 0.0 to 1.0) I may do the following:</p>

<pre><code>double fraction = double(partial)/double(total);
</code></pre>

<p>But if total is too big, the conversion to double may lose information.</p>

<p>Actually, the amount of lost information is tolerable, but I was wondering if there is a algorithm or a std function to get the fraction between two values losing less information.</p>
