Leisure
GithubIssue TrackerSponsor
  • Introduction
  • Installation
  • Changelog
  • F.A.Q.
  • API
    • Static Methods
    • Instance Methods
    • Simplex Methods
    • Combinatorial Methods
    • Random Number Generating Methods
Powered by GitBook
On this page
  • random
  • mersenne
  • xorshift128plus
  • xoroshiro128plus
  • congruential
  • congruential32

Was this helpful?

  1. API

Random Number Generating Methods

PreviousCombinatorial Methods

Last updated 2 years ago

Was this helpful?

These methods create reproducible sequences of random numbers given an initial seed value.

This methods rely on the project.

random

Generates random numbers using the Mersenne Twister generator whose values are within the range 0 to 0xffffffff.

const SEED = 5
const sequence: Seq<number> = random(SEED)
type random = (seed = DEFAULT_SEED) => Seq<number>

mersenne

Generates random numbers using the Mersenne Twister generator whose values are within the range 0 to 0xffffffff.

const SEED = 5
const sequence: Seq<number> = mersenne(SEED)
type mersenne = (seed = DEFAULT_SEED) => Seq<number>

xorshift128plus

Generates random numbers using the xorshift128+ generator whose values are within the range -0x80000000 to 0x7fffffff.

const SEED = 5
const sequence: Seq<number> = xorshift128plus(SEED)
type xorshift128plus = (seed = DEFAULT_SEED) => Seq<number>

xoroshiro128plus

Generates random numbers using the xoroshiro128+ generator whose values are within the range -0x80000000 to 0x7fffffff.

const SEED = 5
const sequence: Seq<number> = xoroshiro128plus(SEED)
type xoroshiro128plus = (seed = DEFAULT_SEED) => Seq<number>

congruential

Generates random numbers using a Linear Congruential generator whose values are within the range 0 to 0x7fff.

const SEED = 5
const sequence: Seq<number> = congruential(SEED)
type congruential = (seed = DEFAULT_SEED) => Seq<number>

congruential32

Generates random numbers using a Linear Congruential generator whose values are within the range 0 to 0xffffffff.

const SEED = 5
const sequence: Seq<number> = congruential32(SEED)
type congruential32 = (seed = DEFAULT_SEED) => Seq<number>
pure-rand