?RCS: $Id: randfunc.U,v 3.0 1993/08/18 12:09:39 ram Exp $
?RCS:
?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS:
-?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
-?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 3.0.
?RCS:
?RCS: $Log: randfunc.U,v $
?X: Andy Dougherty July 1998
?X:
?MAKE:randfunc drand01 seedfunc randbits randseedtype: \
- cat rm test i_stdlib i_unistd Compile Myread Csym ccflags
+ cat rm_try test i_stdlib i_unistd Compile Myread Csym ccflags
?MAKE: -pick add $@ %<
?S:randfunc:
?S: Indicates the name of the random number function to use.
?H:.
?T:cont val
?LINT:change ccflags
-
+?LINT:unclosed $randbits))"
: How can we generate normalized random numbers ?
echo " "
echo "Looking for a random number function..." >&4
echo "OK, found random()." >&4
else
dflt="rand"
- echo "Yick, looks like I have to use rand()." >&4
+ echo "Yuck, looks like I have to use rand()." >&4
fi
echo " "
;;
#endif
int main()
{
- register int i;
- register unsigned long tmp;
- register unsigned long max = 0L;
+ int i;
+ unsigned long tmp;
+ unsigned long max = 0L;
for (i = 1000; i; i--) {
tmp = (unsigned long) $randfunc();
rp="How many bits does your $randfunc() function produce?"
. ./myread
randbits="$ans"
- $rm -f try.c try
+ $rm_try
drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
seedfunc="s$randfunc"
randseedtype=unsigned