Consider the following code:
double v1 = double.MaxValue; double r = Math.Sqrt(v1 * v1);
r = double.MaxValue on 32-bit machine r = Infinity
The problem is that Math.Sqrt expects a double as argument. v1 * v1 cannot be stored as double and overflows resulting in undefined behavior.
v1 * v1