RandPCG v0.1.1 RandPCG View Source

Generate random numbers based on the PCG Algorithm

Link to this section Summary

Types

32 bit unsigned integer Elixir has arbitrary precision, but the random numbers are limited

64 bit unsigned integer Elixir has arbitrary precision, but the random numbers are limited

Functions

Move the state forward

Sets the process incrimenter

Returns random integer, x, such that, 1 <= x <= n

Returns random integer, x, such that, min <= x <= max

Returns a random 32bit integer

Examples

iex> RandPCG.start_link
iex> RandPCG.random
3242229798

Returns a random entry from the enum max 32bit length

Returns a random integer x, min <= x <= max 32bit based

Returns a random integer x, min <= x <= max 32bit based

Sets the process seed

Returns the current state of the process

Sets the current state of the process

Returns a random 32bit integer using XSH RR (good for 64-bit state, 32-bit output)

Link to this section Types

Link to this type uint32() View Source
uint32() :: non_neg_integer

32 bit unsigned integer Elixir has arbitrary precision, but the random numbers are limited

Link to this type uint64() View Source
uint64() :: non_neg_integer

64 bit unsigned integer Elixir has arbitrary precision, but the random numbers are limited

Link to this section Functions

Move the state forward

Link to this function inc(inc) View Source
inc(non_neg_integer) :: non_neg_integer

Sets the process incrimenter

Link to this function rand_int(n, seed) View Source
rand_int(non_neg_integer, non_neg_integer | RandPCG.State.t) :: uint32

Returns random integer, x, such that, 1 <= x <= n

Link to this function rand_int(n, n, seed) View Source
rand_int(non_neg_integer, non_neg_integer, any) :: uint32
rand_int(non_neg_integer, non_neg_integer, uint64 | RandPCG.State.t) :: uint32
rand_int(non_neg_integer, non_neg_integer, RandPCG.State.t) :: uint32
rand_int(non_neg_integer, non_neg_integer, uint64) :: uint32

Returns random integer, x, such that, min <= x <= max

Returns a random 32bit integer

Examples

iex> RandPCG.start_link
iex> RandPCG.random
3242229798
Link to this function random(count) View Source
random(:float) :: float
random(non_neg_integer) :: [uint32]
random([term]) :: term

Returns a random entry from the enum max 32bit length

Link to this function random(min, count) View Source
random(:float, non_neg_integer) :: [float]
random(non_neg_integer, non_neg_integer) :: uint32

Returns a random integer x, min <= x <= max 32bit based

Link to this function random(min, max, count) View Source
random(non_neg_integer, non_neg_integer, non_neg_integer) :: [uint32]

Returns a random integer x, min <= x <= max 32bit based

Link to this function seed(seed) View Source
seed(non_neg_integer) :: uint64

Sets the process seed

Returns the current state of the process

Sets the current state of the process

Returns a random 32bit integer using XSH RR (good for 64-bit state, 32-bit output)