Answers To Exercises

Chapter 1: Introduction

1. The following is pretty accurate:

Image

If e2 is not present in the for loop, the constant 1 is used for it in the above expansion (which would then be a nonterminating loop, unless something in statement terminates it).

Expressing a for loop in terms of a do loop is somewhat awkward, because the body of a do loop is always executed at least once, whereas the body of a for loop may not be executed at all, depending on e1 and e2. Nevertheless, the for loop can be expressed as follows.

Image

Again, if e2 is not ...

Get Hacker’s Delight, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.