Builtins.rand3kaya
Pseudo-random signed integer generator
Usage
Int rand( )
Overview
rand() returns a pseudo-random signed integer in the range +/- (2**31)-1
You must call Builtins.srand (3kaya) before the first call to this function in a program.
-
srand(12345);
for i in [1..5] {
putStr(rand()+" ");
}
Gives: 1995772607 -612336503 -885735441 457910745 1875493919
The rand() function is a low-quality but fast generator - for better quality numbers, use the optional Lfrand(3kaya) module or for cryptographic purposes, your computer's hardware RNG.
Releases
4 releases since Debian 5.0 (Lenny); the text changed 3 times.