1SNOBOL4RANDOM(3) CSNOBOL4 Manual SNOBOL4RANDOM(3)
2
3
4
6 snobol4random - SNOBOL4 random number functions
7
9 -INCLUDE 'random.sno'
10 SRANDOM(number)
11 SRANDOMDEV()
12 number = RANDOM()
13
15 The functions described in this manual page are not cryptographically
16 secure.
17
18 The RANDOM() function uses a non-linear additive feedback random number
19 generator employing a default table of size 31 long integers to return
20 successive pseudo-random numbers in the range from 0 to (2**31)-1. The
21 period of this random number generator is very large, approximately
22 16*((2**31)-1).
23
24 SRANDOM()
25 takes its INTEGER argument as the seed for a new sequence of
26 pseudo-random numbers to be returned by RANDOM(). These sequences
27 are repeatable by calling SRANDOM() with the same seed value.
28 RANDOM() will by default produce a sequence of numbers that can be
29 duplicated by calling SRANDOM() with 1 as the seed.
30
31 SRANDOMDEV()
32 initializes a state array using the random(4) random number device
33 (if available) which returns good random numbers, suitable for
34 cryptographic use. Note that this particular seeding procedure can
35 generate states which are impossible to reproduce by calling
36 SRANDOM() with any value, since the succeeding terms in the state
37 buffer are no longer derived from the LC algorithm applied to a
38 fixed seed. Data from the random(4) device may be precious, and
39 repeated calls to SRANDOMDEV() should be avoided. When the
40 random(4) device is not available, a 32-bit seed will be generated
41 using time, process id, and an element of the process stack.
42
44 snobol4(1), random(3), random(4).
45
47 Earl T. Cohen
48 Jacob S. Rosenberg
49 Philip L. Budne
50
51
52
53CSNOBOL4B 2.3.1 March 31, 2022 SNOBOL4RANDOM(3)