Pseudo random numbers generator from Stroustrup's PPP using C++, chapter 8, exercises 8 and 9
<p>I'm trying to solve exercises 8 and 9 from B. Stoustrup's book's, "Programming -- Principles and Practice Using C++", eighth chapter.</p>

<p>Exercise 8 involves writing a function named <code>randint()</code> that generates a random integer in the range <code>[0;MAXINT]</code>. What is MAXINT supposed to be? Is it the greater number possible to store in an int? Is it an argument to the function? The author doesn't state it. The only hint given is: "<em>The Art of Programming</em>, Knuth, vol. 2". That book describes an algorithm called the <a href="http://en.wikipedia.org/wiki/Linear_congruential_method" rel="nofollow">linear congruential method</a>, which involves 4 parameters (see linked Wikipedia article).</p>

<p>Exercise 9 involves using the <code>randint(int a, int b)</code> function from exercise 8 to generate a random integer in the range <code>[a;b]</code>.</p>

<p>Now I could write a single function implementing the linear congruential method, with 4 arguments, but that's not what the author wants. I'm trying to understand WHAT he wants, and wondering if someone solved these exercises. Unfortunately there's no solution to these exercises on the author's website.</p>

<p>Thanks for your suggestions.</p>
