Wrapper around an instance of a pure-rand's random number generator offering a simpler interface to deal with random with impure patterns

Hierarchy

  • Random

Constructors

  • Create a mutable random number generator by cloning the passed one and mutate it

    Parameters

    • sourceRng: RandomGenerator

      Immutable random generator from pure-rand library, will not be altered (a clone will be)

    Returns Random

Properties

internalRng: RandomGenerator
DBL_DIVISOR: number = ...
DBL_FACTOR: number = ...
MAX_INT: number = ...
MIN_INT: number = ...

Methods

  • Generate a random ArrayInt between min (included) and max (included)

    Parameters

    • min: {
          data: number[];
          sign: 1 | -1;
      }

      Minimal ArrayInt value

      • data: number[]
      • sign: 1 | -1
    • max: {
          data: number[];
          sign: 1 | -1;
      }

      Maximal ArrayInt value

      • data: number[]
      • sign: 1 | -1

    Returns {
        data: number[];
        sign: 1 | -1;
    }

    • data: number[]
    • sign: 1 | -1
  • Generate a random bigint between min (included) and max (included)

    Parameters

    • min: bigint

      Minimal bigint value

    • max: bigint

      Maximal bigint value

    Returns bigint

Generated using TypeDoc