RandEXom / Docs
  • Project home
  • Guide map
  • Class index

2.2.3 SSRNGRandom

Parent: 2.2 RandomLib: random sources · Guide map

SSRNGRandom exposes historical system-supplied LCG parameter presets. It can construct a matching LCGSeedR from a preset, or accept an ISeedR and an output modulus. Use it when a particular generator family or preset is part of your experiment, not as a security primitive.

using RandEXom.RandomLib;

var random = new SSRNGRandom(
    SSRNGRandom.ParameterTemplate.Numerical_Recipes,
    seed: 42);
int value = random.NextInt(0, 100);

Available presets: ZX81, Numerical_Recipes, Borland_C, GLIBC, IBM, Borland_Delphi, Turbo_Pascal, Microsoft_Visual_C, Microsoft_Visual_Basic, RtlUniform, Apple_CarbonLib, C_Plus_11, MTH_RANDOM, Java, random0, POSIX, cc65, cc65_2, and RANDU. The output modulus must be greater than one.

The default LCG constants are attributed to the Numerical Recipes in C book. L’Ecuyer’s paper on LCG parameter quality is relevant background, not the source of every named preset. See research and provenance.


← Previous: 2.2.2 NetRandom · Parent: 2.2 RandomLib: random sources · Next: 2.2.4 Choosing a source →

  • Improve this Doc
In This Article
Back to top Generated by DocFX