rand

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Overview

Package rand is used for concurrency safe random number generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rand

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

Rand is used for concurrency safe random number generator.

func New

func New(seed int64) *Rand

New returns a new Rand from seed.

func (*Rand) Int

func (r *Rand) Int() int

Int returns a non-negative pseudo-random int from the Source in Rand.r.

func (*Rand) Perm

func (r *Rand) Perm(n int) []int

Perm returns, as a slice of n ints, a pseudo-random permutation of the integers in the half-open interval [0,n) from the Source in Rand.r.

Jump to

Keyboard shortcuts

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