Aims:
while
-loop
for unbounded repetition
if ( sqrt(2) * sqrt(2) == 2 )
{
echo 'Yes';
}
<form action="root.php" method="get"> <input type="text" name="number" /> <input type="text" name="epsilon" /> <input type="submit" /> </form>In the rest of the lecture we'll write
root.php
$lo
and $hi
$lo
will 0 and $hi
will be
the number the user supplies
and $guess
will be the number the user supplies
$guess
is 'good enough', we will stop
$guess
was too big, our next guess can lie halfway between
$lo
and $guess
$guess
was too small, our next guess can lie halfway between
$guess
and $hi
while
-loop
for this, rather than a for
-loop?