xrand

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64

func Float64() float64

Float64 returns a uniformly distributed random number in the interval [0.0, 1.0).

func Intn

func Intn(n int) int

Intn returns a uniformly distributed random number in the interval [0, n). n must be a positive int32.

func SampleWeighted

func SampleWeighted[T any](items []T, weights []float64, n int) []T

SampleWeighted samples n items from items without replacement. Panics if n < 0 or n > len(items).

Types

This section is empty.

Jump to

Keyboard shortcuts

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