Help us shape the future of Go! Take the 2026 Go Developer Survey

random

package
v0.84.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGenerator = rand.New(rand.NewSource(time.Now().UnixNano()))

DefaultGenerator is the default generator for calls to Rand()

Functions

func Decimal

func Decimal() decimal.Decimal

Decimal returns a random decimal in the range [0.0, 1.0)

func IntN

func IntN(n int) int

IntN returns a random integer in the range [0, n)

func NewSeededGenerator

func NewSeededGenerator(seed int64) *rand.Rand

NewSeededGenerator creates a new seeded generator

func SetGenerator

func SetGenerator(rnd *rand.Rand)

SetGenerator sets the rand used by Rand()

Types

This section is empty.

Jump to

Keyboard shortcuts

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