RandPCG v0.1.2 RandPCG.PCG 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

Generate a state from :os.system_time(:micro_seconds) and advance it once

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

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

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

Generate a state from :os.system_time(:micro_seconds) and advance it once

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 using XSH RR (good for 64-bit state, 32-bit output)