Divide by zero prevention
<p>What is <code>1.#INF</code> and why using <code>(float)</code> or <code>(double)</code> prevents a division by 0 of crashing?<br>
Also, any great ideas of how to prevent division by 0? (Like any macro or template)?</p>

<pre><code>int nQuota = 0;

int nZero = 3 / nQuota; //crash
cout &lt;&lt; nZero &lt;&lt; endl;

float fZero = 2 / nQuota; //crash
cout &lt;&lt; fZero &lt;&lt; endl;
</code></pre>

<p>if I use instead:</p>

<pre><code>int nZero = 3 / (float)nQuota;
cout &lt;&lt; nZero &lt;&lt; endl;
//Output = -2147483648

float fZero = 2 / (float)nQuota;
cout &lt;&lt; fZero &lt;&lt; endl;
//Output = 1.#INF
</code></pre>
