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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.