rand

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: MIT Imports: 3 Imported by: 4

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