Zafu/Testing/HedgeHog/Seed

Zafu/Testing/HedgeHog/Seed

source code:

Index

Types

Seed

HedgeHog generator seed backed by local xoshiro256** state.

type Seed

UInt64

Unsigned 64-bit sample value emitted by the HedgeHog PRNG.

type UInt64

Values

choose_Float64

Sample a Float64 uniformly from the half-open interval [lower, upper).

references: Float64, Seed, Tuple2

def choose_Float64(seed: Seed, lower: Float64, upper: Float64) -> (Seed, Float64)

choose_Int

Sample an integer uniformly from an inclusive range.

references: Int, Seed, Tuple2

def choose_Int(seed: Seed, lower: Int, upper: Int) -> (Seed, Int)

from_Int

Build a non-zero seed from an integer.

references: Int, Seed

def from_Int(i: Int) -> Seed

next

Xoshiro256** over the same 4x64-bit state shape as Bosatsu/Rand, but exposed locally so HedgeHog no longer depends on Bosatsu/Rand. Advance the PRNG and return the next seed plus one 64-bit sample.

references: Seed, Tuple2, UInt64

def next(seed: Seed) -> (Seed, UInt64)

to_Float64

Convert a UInt64 sample into a non-negative Float64 value.

references: Float64, UInt64

def to_Float64(value: UInt64) -> Float64

to_Int

Expose the raw integer bits of a UInt64 sample.

references: Int, UInt64

def to_Int(value: UInt64) -> Int