1 ?RCS: $Id: randbits.U,v 3.0.1.1 1997/02/28 16:19:29 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: randbits.U,v $
12 ?RCS: Revision 3.0.1.1 1997/02/28 16:19:29 ram
13 ?RCS: patch61: added <unistd.h> and <stdlib.h> to the C program test
15 ?RCS: Revision 3.0 1993/08/18 12:09:38 ram
16 ?RCS: Baseline for dist 3.0 netwide release.
19 ?X: This unit has been somewhat made obsolete with creation of the
20 ?X: randfunc function (which finds out how to generate random
21 ?X: numbers between 0 and 1.
23 ?MAKE:randbits: cat rm Myread cc i_unistd i_stdlib
24 ?MAKE: -pick add $@ %<
26 ?S: This variable contains the eventual value of the RANDBITS symbol,
27 ?S: which indicates to the C program how many bits of random number
28 ?S: the rand() function produces.
31 ?C: This symbol contains the number of bits of random number the rand()
32 ?C: function produces. Usual values are 15, 16, and 31.
34 ?H:#define RANDBITS $randbits /**/
36 : check for size of random number generator
40 echo "Checking to see how many bits your rand function produces..." >&4
56 register unsigned long tmp;
57 register unsigned long max = 0L;
59 for (i = 1000; i; i--) {
60 tmp = (unsigned long)rand();
61 if (tmp > max) max = tmp;
68 if $cc -o try try.c >/dev/null 2>&1 ; then
72 echo "(I can't seem to compile the test program...)"
79 rp='How many bits does your rand() function produce?'