class: RandomParkMiller
authorClaus Gittinger <cg@exept.de>
Wed, 01 Oct 2014 13:12:17 +0200
changeset 3338 4c5ab3702414
parent 3337 c4e5a66cad48
child 3339 72f6d17dc008
class: RandomParkMiller added: #nextBoolean
RandomParkMiller.st
--- a/RandomParkMiller.st	Wed Oct 01 13:06:21 2014 +0200
+++ b/RandomParkMiller.st	Wed Oct 01 13:12:17 2014 +0200
@@ -86,6 +86,12 @@
     ^ seed * PMmu1
 !
 
+nextBoolean
+    " This method generates a boolean "
+
+    ^ self next > 0.5
+!
+
 nextInteger
     " This method generates random instances of Integer in the interval 0 to 16r7FFFFFFF. "
 
@@ -129,11 +135,12 @@
 !RandomParkMiller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/RandomParkMiller.st,v 1.4 2010-03-06 11:29:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/RandomParkMiller.st,v 1.5 2014-10-01 11:12:17 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/RandomParkMiller.st,v 1.4 2010-03-06 11:29:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/RandomParkMiller.st,v 1.5 2014-10-01 11:12:17 cg Exp $'
 ! !
 
+
 RandomParkMiller initialize!