pkgrand

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64Range

func Float64Range(r Rand, min, max float64) float64

func IntRange

func IntRange(r Rand, min, max int64) int64

IntRange generates an integer in range of min and max. It never panics. It will swap min and max if min is bigger than max. [min, max]

func IntRangeArray

func IntRangeArray(r Rand, count, min, max int64) []int64

func UintRange

func UintRange(r Rand, min, max uint) uint

Types

type Rand

type Rand interface {
	Float64() float64
	Float32() float32
	Int63n(n int64) int64
	Uint64() uint64
	Intn(n int) int
	Read(p []byte) (n int, err error)
}

Rand is an interface for random number generators.

func NewMathRand

func NewMathRand(seed int64) Rand

NewMathRand returns a new Rand that uses math/rand.

Jump to

Keyboard shortcuts

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