C# Programming Best Practices For Mathematical Calculations
<p>Can anyone let me know where can I read the best practices to write an application that relies heavily on mathematical calculations? For example, suppose I was asked to write a C# application that generates 100 even numbers. I would write the following:</p>

<pre><code>public void GenerateEven() {
    for (int i=0;i&lt;100;i++) {
        Console.WriteLine(i * 2);
    }
}
</code></pre>

<p>However that is not the best practice to do. The best way to generate even number would be, for example:</p>

<pre><code>public void GenerateEven() {
    int i=0;
    while (i &lt;200) {
        if (i % 2 == 0) {
        Console.Writeline(i);
        }
    }
}
</code></pre>
