SimpleRandom

object SimpleRandom

A random number generator that focuses on speed and lack of inter-thread interference, rather than on the quality of the numbers returned. The object SimpleRandom is striped internally to reduce contention when accessed from multiple threads. The class SimpleRandom should only be used by a single thread.

A random number generator that focuses on speed and lack of inter-thread interference, rather than on the quality of the numbers returned. The object SimpleRandom is striped internally to reduce contention when accessed from multiple threads. The class SimpleRandom should only be used by a single thread.

The constants in this 64-bit linear congruential random number generator are from http://nuclear.llnl.gov/CNP/rng/rngman/node4.html.

Authors

Nathan Bronson

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def nextInt(): Int

Returns a random value chosen from a uniform distribution of all valid Ints.

Returns a random value chosen from a uniform distribution of all valid Ints.

def nextInt(n: Int): Int

Returns a random value chosen from a uniform distribution of the non-negative integers less than n, or throws IllegalArgumentException if n is negative or zero.

Returns a random value chosen from a uniform distribution of the non-negative integers less than n, or throws IllegalArgumentException if n is negative or zero.