Page 39, line 6 (canonical form of a for-loop)
- Code: Select all
for (init-expr; test-expr; incr-expr) structured-block
Page 39, lines 12-14
- Code: Select all
test-expr One of the following:
var relational-op b
b relational-op var
Page 39, lines 34-38
- Code: Select all
relational-op One of the following:
<
<=
>
>=
Page 45, lines 8-10
- Code: Select all
If relational-op is < or <= then incr-expr must cause var to increase on each
iteration of the loop. Conversely, if relational-op is > or >= then incr-expr
must cause var to decrease on each iteration of the loop.
However, if test-expr is of the form "b < var", and the value of var must be
increased on each iteration of the loop, then test-expr will always evaluate to true
(barring any wrap-around) if it wasn't false to begin with. Similarly, if test-expr is
of the form "b > var", and the value of var must be decreased on each iteration of the loop,
then test-expr will always evaluate to true if (again, disregarding wrap-around) if it wasn't
false to begin with.
--
Nathan Weeks
