Options
All
  • Public
  • Public/Protected
  • All
Menu

An almost complete implementation in JS of the java.util.Random class from J2SE, designed to so far as possible produce the same output sequences as the Java original when supplied with the same seed. See https://www.npmjs.com/package/java-random for more information.

Hierarchy

  • Random

Index

Constructors

Methods

Constructors

  • new Random(seed?: number): Random

Methods

  • nextDouble(): number
  • Returns a pseudorandom double value between 0.0 and 1.0.

    Returns number

    Pseudorandom double value between 0.0 and 1.0

  • nextInt(bound?: number): number
  • Returns a pseudorandom int value (between zero and the specified upper bound).

    Parameters

    • Optional bound: number

      Upper bound (exclusive)

    Returns number

    Pseudorandom int value (between zero and the specified upper bound)

Generated using TypeDoc