rand

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Seeded

type Seeded struct {
	// contains filtered or unexported fields
}

Seeded contains a self-contained, seeded (math/rand).Rand. It allows you to generate random numbers in a concurrency-safe manner.

Create one of these with NewSeeded()

func NewSeeded

func NewSeeded() *Seeded

NewSeeded creates a new Seeded

func (*Seeded) Intn

func (s *Seeded) Intn(max int) int

Intn returns, as an int, a non-negative pseudo-random number in [0,n) from the internally held seeded random number generator.

It panics if n <= 0.

This function (and its documentation!) is similar to (math/rand).Intn(max)

Jump to

Keyboard shortcuts

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