eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RandomKISS2':

Home

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

Class: RandomKISS2


Inheritance:

   Object
   |
   +--RandomKISS2

Package:
stx:libbasic2
Category:
Magnitude-Numbers-Random
Version:
rev: 1.8 date: 2018/03/02 13:04:27
user: cg
file: RandomKISS2.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Ported to Smalltalk by Claus Gittinger.

Description:


Warning: this generator should not be used for cryptographic work.

NO WARRANTY

KISS combines a linear congruence, XorShift and Lag with carry generator.
The idea is from George Marsaglia.
KISS2 uses slightly different parameters and initial state.

RandomKISS2 new nextInteger
(RandomKISS2 new:5489) nextInteger

If heavily used, it may be useful to embed the original C code as inline C code for a big speedup)

Please read:
    http://www.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf


Related information:

    RandomGenerator
    -
    the
    default;
    uses
    the
    machine's
    /dev/random
    if
    available
    Random
    -
    fast,
    but
    generates
    less
    quality
    random
    numbers
    RandomTT800
    -
    another
    random
    generator
    RandomParkMiller
    -
    another
    random
    generator
    RandomMT19937
    -
    another
    random
    generator

Class protocol:

instance creation
o  new

o  new: seed


Instance protocol:

initialization
o  initialize
<- any seed != 0

o  seed: seed

random numbers
o  nextBoolean
generates a boolean random

o  nextInteger
generates the next integer in 0..FFFFFFFF



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 00:34:13 GMT