add directory Minix
This commit is contained in:
22
Minix/1.7.5/MANUALS/CAT3/LRAND.3
Normal file
22
Minix/1.7.5/MANUALS/CAT3/LRAND.3
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
SUBROUTINES
|
||||
lrand - lehmer random number generator
|
||||
INVOCATION
|
||||
long seed( lseed )
|
||||
long lseed;
|
||||
long lrand()
|
||||
EXPLANATION
|
||||
Lrand(3) uses a prime modulus multiplicative linear
|
||||
congruential generator (PMMLCG) to generate a pseudo-
|
||||
random number in the range 1 to 2147483646 {LONG_MAX}-1.
|
||||
The generator is much more random than rand(3), especially
|
||||
in the low order bits. The formula used is:
|
||||
seed = (16807 * seed) % 2147483647
|
||||
Seed(3) sets the seed to an initial value, the default
|
||||
is 1.
|
||||
RESULTS
|
||||
Lrand(3) returns the next value of seed.
|
||||
Seed(3) returns the previous value of seed.
|
||||
REFERENCES
|
||||
rand(3)
|
||||
|
||||
Reference in New Issue
Block a user