10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

544 Appendix BOOK PSEUDOCODE<br />

}<br />

...;<br />

which means that x is checked for zero value upon entry of the whole loop,<br />

then all the interior tasks are to be performed until, after some complete pass<br />

of the interior tasks, x is found to be zero and that ends the while() looping.<br />

Operations that change the value of a single variable include these:<br />

x = x + c; // x is increased by c.<br />

x = cx; // x is multiplied by c.<br />

x = x3; // Shift right, same as x = ⌊x/8⌋.<br />

x = x ∧ 37; // Exclusive-or bits of x with 0 ...0100101 binary.<br />

x = x &37; // And bits of x with 0 ...0100101 binary.<br />

For() loops<br />

The for() loop is ubiquitous in this book, in being our primary automaton for<br />

executing tasks repeatedly. Again we defer to a set of examples, not trying<br />

rigorously to exhaust all possible forms of English-C loops possible, rather,<br />

covering some of the common styles appearing in the book.<br />

for(a ≤ x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!