Lines Matching defs:random

33  * $FreeBSD: src/lib/libc/stdlib/random.c,v 1.13 2000/01/27 23:06:49 jasone Exp $
38 static const char sccsid[] = "@(#)random.c 8.2 (Berkeley) 5/19/95";
41 #include "random.h" /* gawk addition */
58 /* For gawk, don't this, use the decl of random() in random.h */
74 * random.c:
76 * An improved random number generation package. In addition to the standard
80 * then initialized to contain information for random number generation with
85 * information and generates far better random numbers than a linear
97 * The random number generation technique is a linear feedback shift register
104 * influenced by pseudo-random carries out of the lower bits. The total
125 * state information and generates far better random numbers than a linear
133 * For each of the currently supported random number generators, we have a
135 * many bytes of state info to support this random number generator), a degree
191 /* The random sequences do not vary much with the seed */
212 * could get away with just one pointer, but the code for random() is more
229 * of random(), we remember the first location of the state information, not
249 * The random sequences do not vary much with the seed,
276 * Initialize the random number generator based on the given seed. If the
300 (void)random();
348 * even to generate a random number, but we do it anyway.
368 * random number generation. Based on the number of bytes we are given, and
402 "random: not enough state (%ld bytes); ignored.\n", n);
480 "random: state info corrupted; not changed.\n");
492 * random:
500 * generated, reduced to 31 bits by throwing away the "least random" low bit.
506 * Returns a 31-bit random number.
509 random()
523 i = (*f >> 1) & 0x7fffffff; /* chucking least random bit */