eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RandomBlumBlumShub':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: RandomBlumBlumShub


Inheritance:

   Object
   |
   +--RandomBlumBlumShub

Package:
stx:libbasic2
Category:
Magnitude-Numbers-Random
Version:
rev: 1.6 date: 2021/01/20 13:06:38
user: cg
file: RandomBlumBlumShub.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


NO WARRANTY

This generator uses the blum blub shub algorithm to generate random numbers.
It is very slow, but considered to provide good random numbers.

RandomBlumBlumShub new nextInteger

copyright

COPYRIGHT (c) 2014 Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

instance creation
o  new
(comment from inherited method)
return an instance of myself without indexed variables

o  new: seed
(comment from inherited method)
return an instance of myself with anInteger indexed variables


Instance protocol:

initialization
o  initialize
The two primes, p and q, should both be congruent to 3 (mod 4)

Usage example(s):

     self new initialize

o  seed: seedArg
isCoprimeWith:

random numbers
o  nextBoolean
generates the next random boolean

o  nextInteger
generates the next integer in 0..FFFFFFFF

Usage example(s):

     self new nextInteger.

     |r|
     r := self new
     100 timesRepeat:[ Transcript showCR:r nextInteger].



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:25:08 GMT