[][src]Module randomize::formulas

Various generator and conversion formulas. This module is a "junk drawer" of stuff.

For common usage of the library you do not need to read or understand anything here, except perhaps the float conversions as described in the crate root. Most of it is provided for sake of completeness only.

Constants

DEFAULT_PCG_INC

A suggested default increment for a PCG.

DEFAULT_PCG_SEED

A suggested default seed for a PCG.

PCG_MULTIPLIER_8

The PCG multiplier for 8 bits of state

PCG_MULTIPLIER_16

The PCG multiplier for 16 bits of state

PCG_MULTIPLIER_32

The PCG multiplier for 32 bits of state

PCG_MULTIPLIER_64

The PCG multiplier for 64 bits of state

PCG_MULTIPLIER_128

The PCG multiplier for 128 bits of state

Functions

f32_half_open_right

u32 to [0.0, 1.0)

f32_half_open_left

u32 to (0.0, 1.0]

f32_open

u32 to (0.0, 1.0)

f32_closed

u32 to [0.0, 1.0]

f32_closed_neg_pos

u32 to [-1.0, 1.0]

f64_half_open_right

u64 to [0.0, 1.0)

f64_half_open_left

u64 to (0.0, 1.0]

f64_open

u64 to (0.0, 1.0)

f64_closed

u64 to [0.0, 1.0]

f64_closed_neg_pos

u64 to [-1.0, 1.0]

jump_lcg8

Gives the lcg8 output delta steps from now in log(delta) time.

jump_lcg16

Gives the lcg16 output delta steps from now in log(delta) time.

jump_lcg32

Gives the lcg32 output delta steps from now in log(delta) time.

jump_lcg64

Gives the lcg64 output delta steps from now in log(delta) time.

jump_lcg128

Gives the lcg128 output delta steps from now in log(delta) time.

lcg8

The u8 LCG.

lcg16

The u16 LCG.

lcg32

The u32 LCG.

lcg64

The u64 LCG.

lcg128

The u128 LCG.

pcg_core_state8

Advances a PCG with 8 bits of state

pcg_core_state16

Advances a PCG with 16 bits of state

pcg_core_state32

Advances a PCG with 32 bits of state

pcg_core_state64

Advances a PCG with 64 bits of state

pcg_core_state128

Advances a PCG with 128 bits of state

pkmn_colosseum

The LCG from a game with "colosseum" in its name.

pkmn_gen4alt

The alternate LCG from the gen4 games.

pkmn_gen3gen4

The LCG from the gen3 and gen4 games.

pkmn_gen5gen6

The LCG from the gen5 and gen6 games.

rxs_m_xs_128_128

Permutation: RXS M XS u128

rxs_m_xs_16_16

Permutation: RXS M XS u16

rxs_m_xs_32_32

Permutation: RXS M XS u32

rxs_m_xs_64_64

Permutation: RXS M XS u64

rxs_m_xs_8_8

Permutation: RXS M XS u8

sm64

The Super Mario 64 PRNG. Only use this as a joke.

xsh_rr_128_64

Permutation: XSH RR u128 to u64

xsh_rr_16_8

Permutation: XSH RR u16 to u8

xsh_rr_32_16

Permutation: XSH RR u32 to u16

xsh_rr_64_32

Permutation: XSH RR u64 to u32

xsh_rs_128_64

Permutation: XSH RS u128 to u64

xsh_rs_16_8

Permutation: XSH RS u16 to u8

xsh_rs_32_16

Permutation: XSH RS u32 to u16

xsh_rs_64_32

Permutation: XSH RS u64 to u32

xsl_rr_128_64

Permutation: XSL RR u128 to u64

xsl_rr_64_32

Permutation: XSL RR u64 to u32

xsl_rr_rr_128_128

Permutation: XSL RR RR u128

xsl_rr_rr_64_64

Permutation: XSL RR RR u64