may be a bug with calling function
<pre><code>#include &lt;iostream&gt;
using namespace std;

bool prime(float test) {
    float fac = 3;
    while (fac &lt; sqrt(test)); {
        if (test/fac == floor(test/fac)) {
            fac++;
            fac++;


    return false;
        }
        fac++;
        fac++;
    }
    return true;
}
float main() {
    float total = 2;
    float test = 3;
    while (test&lt;2000000) {
        if (prime(test)) total = test + total;
        cout &lt;&lt; "Testing " &lt;&lt; test &lt;&lt; endl;
        test++;
        test++;
    }
    return total;
}
</code></pre>

<p>I'm trying to find the sum of all primes up to two million, but it keeps looping on 9. I'm probably missing something obvious here, but I can't seem to find it.</p>
