equal
deleted
inserted
replaced
12 documentation |
12 documentation |
13 " |
13 " |
14 NO WARRANTY |
14 NO WARRANTY |
15 |
15 |
16 Another pseudo-random number generator |
16 Another pseudo-random number generator |
|
17 |
|
18 The ParkMiller random generator (although better than the old Random), is not recommended |
|
19 when a high quality random is required (for example, for cryptographic work). |
|
20 Applications should use either the OS-random generator or a LaggedFibonacci generator. |
|
21 This is because the random values provided by the Park-Miller generator are double precision |
|
22 floating point numbers which have up to 53 significant bits. Since only the first 31 bits |
|
23 of their mantissa are known to have good random properties, the behavior of the remaining |
|
24 22 bits is undefined. |
|
25 In particular, bit aliasing occurs during the calculation of the next random value, |
|
26 and bit 22 of the mantissa is always 1. |
17 |
27 |
18 Please read: |
28 Please read: |
19 Standard reference by Park and Miller in |
29 Standard reference by Park and Miller in |
20 'Random Number Generators: Good Ones Are Hard to Find', |
30 'Random Number Generators: Good Ones Are Hard to Find', |
21 Comm. ACM, 31:1192-1201, 1988. |
31 Comm. ACM, 31:1192-1201, 1988. |
117 ! ! |
127 ! ! |
118 |
128 |
119 !RandomParkMiller class methodsFor:'documentation'! |
129 !RandomParkMiller class methodsFor:'documentation'! |
120 |
130 |
121 version |
131 version |
122 ^ '$Header: /cvs/stx/stx/libbasic2/RandomParkMiller.st,v 1.3 2008-12-16 22:40:21 cg Exp $' |
132 ^ '$Header: /cvs/stx/stx/libbasic2/RandomParkMiller.st,v 1.4 2010-03-06 11:29:21 cg Exp $' |
|
133 ! |
|
134 |
|
135 version_CVS |
|
136 ^ '$Header: /cvs/stx/stx/libbasic2/RandomParkMiller.st,v 1.4 2010-03-06 11:29:21 cg Exp $' |
123 ! ! |
137 ! ! |
124 |
138 |
125 RandomParkMiller initialize! |
139 RandomParkMiller initialize! |