changed initial seed generation, to avoid repeating
authorClaus Gittinger <cg@exept.de>
Fri, 06 Dec 2002 11:17:28 +0100
changeset 1127 2bace63d7bd5
parent 1126 0ca4b7558465
child 1128 72d61e6ef2b1
changed initial seed generation, to avoid repeating initial numbers, in case of many generators beeing created within the same millisecond
Random.st
--- a/Random.st	Fri Nov 29 12:09:14 2002 +0100
+++ b/Random.st	Fri Dec 06 11:17:28 2002 +0100
@@ -505,11 +505,15 @@
     seed := Time millisecondClockValue bitAnd:16rFFFF.
     RandomSalt isNil ifTrue:[
         RandomSalt := 1.
+    ] ifFalse:[
+        RandomSalt := RandomSalt + 1.
     ].
     seed := seed + RandomSalt.
     multiplier := 1597.
     increment := 51749.
-    modulus := 244944.
+    modulus := 244944 " 244957 " .
+
+    self step.
 
     "Modified: / 1.4.1997 / 22:44:13 / cg"
     "Modified: / 12.11.1999 / 17:50:52 / stefan"
@@ -546,5 +550,5 @@
 !Random class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.30 2001-11-17 11:08:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/Random.st,v 1.31 2002-12-06 10:17:28 cg Exp $'
 ! !