Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RandomInt

Represents a random variable that returns integer values between 0 and a given maximum value.

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new RandomInt(max: number, seed?: number): RandomInt
  • Initializes a new instance of the RandomInt class.

    Parameters

    • max: number

      Maximum value.

    • Optional seed: number

      Optional value used to initialize the random sequence.

    Returns RandomInt

Accessors

max

  • get max(): number
  • Gets the maximum value of the generated values.

    Returns number

Methods

sample

  • sample(): number
  • Gets a random integer between zero and max.

    Returns number

Generated using TypeDoc