rnd

package
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package rnd provides lock-free, allocation-free random helpers. It avoids the global rand lock by sharding PRNG state and using atomic round-robin across shards.

API is tiny on purpose: Float64(), Uint64(), Int63n().

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64

func Float64() float64

Float64 returns a uniform in [0,1) using 53 random bits (double precision).

func Init

func Init(n int)

Init optionally reconfigures shard count. If n<=0, it uses GOMAXPROCS*4. Shard count is rounded up to power of two for a cheap mask.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL