C# - Inconsistent math operation result on 32-bit and 64-bit
<p>Consider the following code:</p>

<pre><code>double v1 = double.MaxValue;
double r = Math.Sqrt(v1 * v1);
</code></pre>

<p>r = double.MaxValue on 32-bit machine
r = Infinity on 64-bit machine</p>

<p>We develop on 32-bit machine and thus unaware of the problem until notified by customer. Why such inconsistency happens? How to prevent this from happening?</p>
