Class FastRandom

Constructors

Properties

INT_MASK: number = ...
INT_TO_REAL: number = ...
MAX_INT32: number = 2147483647
MAX_UINT32: number = 4294967295

Methods

  • Generates a random unsigned integer within the range [0, MAX_UINT32).

    Returns number

    The random value.

  • Generates a random boolean value. Cached such that a random value is only generated once in every 32 calls.

    Returns boolean

    The random value.

  • Generates a random double value within the range [0, 1).

    Returns number

    The random value.

  • Generates a random integer value within the range [lowerBound, upperBound).

    Parameters

    • lowerBound: number = 0

      The lower bound of the range.

    • upperBound: number = FastRandom.MAX_INT32

      The upper bound of the range.

    Returns number

    The random integer value.

  • Generates a random unsigned integer value within the range [lowerBound, upperBound).

    Parameters

    • lowerBound: number = 0

      The lower bound of the range.

    • upperBound: number = FastRandom.MAX_INT32

      The upper bound of the range.

    Returns number

    The random integer value.