<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Infinite loop - Page 19 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=infinite_loop&amp;p=18">1.Previous</a><br />
<a accesskey="3" href="page.php?w=infinite_loop&amp;p=20">3.Next</a>
</p>
<p>with the == (equality test) operator. Instead, this will assign the value of 5 to <code>a</code> at this point in the program. Thus, <code>a</code> will never be able to advance to 10, and this loop cannot terminate.</p>

<p><big>Rounding errors</big></p>
<p>Unexpected behavior in evaluating the terminating condition can also cause this problem. Here is an example in <a href="page.php?w=C_%28programming_language%29">C</a>:</p>

<p><syntaxhighlight lang="c">float x = 0.1;while (x != 1.1) {    printf("x = %22.20f\n", x);    x += 0.1;}</syntaxhighlight></p>

<p>On</p><p>
<a accesskey="1" href="page.php?w=infinite_loop&amp;p=18">1.Previous</a><br />
<a accesskey="3" href="page.php?w=infinite_loop&amp;p=20">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
