Debian Codegraph @

random/README

raw
1 This directory contains a dynamically loadable tcl extension which
2 supports random number generation. This extension defines a tcl
3 command called "random" which returns a random value. The
4 distribution from which the value is taken is specified by the command
5 arguments.
6
7 This source is *apparently* freeware; no authorship or copyright has been
8 declared in the source.
9
10 By default, with no arguments the number is taken uniformly from [0..1)
11
12 "random -reset" will cause the generator to be reseeded using
13 current pid and current time.
14
15 "random -integer [a [b]]" will cause the number returned to be rounded
16 down to the largest integer less than or equal to the number which
17 would otherwise be returned. By default, the number returned is
18 within the range of a 32-bit signed integer. It is capable of
19 returning numbers up to 64 bits unsigned. With option "random
20 -integer a", the number returned will be between (-a) and (+a).
21 With option "random -integer a b", the number returned will be
22 between (a) and (b).
23
24 "random -bitstream [n]" will generate a uniform random binary value
25 of length n. The value returned is in string form, with
26 effectively unlimited length. By default, the number returned is
27 a 32-bit value (32-character string).
28
29 "random -normal m s" will cause the number returned to be taken
30 from a gaussian with mean m and standard deviation s.
31
32 "random -exponential m" will cause the number returned to be taken
33 from an exponential distribution with mean m.
34
35 "random -uniform low high" will cause the number returned to be
36 taken from uniform distribution on [a,b).
37
38 "random -chi2 n" will cause the number returned to be
39 taken from chi2 distribution with n degrees of freedom.
40
41 "random -select n list" will cause n elements to be selected at
42 random from the list with replacement.
43
44 "random -choose n list" will cause n elements to be selected at
45 random from the list without replacement.
46
47 "random -permutation n" will return a permutation of 0..n-1
48
49 "random -permute $list" will return a permutation of $list