RandomState

com.phasmidsoftware.number.core.numerical.RandomState
See theRandomState companion object
class RandomState(r: Random)

This class represents a stateful random number generator.

Value parameters

r

a random source of type java.util.Random.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def value(bits: Int): BigInt

Method to yield a random BigInt with the given number of bits.

Method to yield a random BigInt with the given number of bits.

Value parameters

bits

the number of bits desired.

Attributes

Returns

a BigInt with bits bits.

def value(x: BigInt): BigInt

Method to yield a random BigInt modulo x.

Method to yield a random BigInt modulo x.

Value parameters

x

a BigInt.

Attributes

Returns

a random BigInt in the range 0...x-1

Concrete fields

lazy val next: RandomState

Method to yield the next RandomState in the pseudo-random series.

Method to yield the next RandomState in the pseudo-random series.

Attributes

Returns

a RandomState seeded by r.nextLong().