Comparing double values
<p>I have a double whose value i get dynamically and the value is 0.94289988675 and also i get a another double whose value is 0.94289988777 .I just need to compare the two values. But it says they are not same. How can i compare till first four digits of those values.</p>

<p><strong>Code</strong>: </p>

<pre><code>for (z = 0; z &lt; something.Count(); z++)
{
    if (largest == Math.Round(0.94289988675 [z],4))
    {
        //proceed
    }
}
</code></pre>

<p>largest = 0.94289988675 
0.94289988675[z] comes 0.94289988777. z is.</p>

<p>It does not go in the loop. Please help me out.</p>
