rng

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64

func Float64() float64

Float64 returns a float64 uniformly in [0, 1). Safe for concurrent callers.

func Int

func Int() int

Int returns a random int. Safe for concurrent callers.

func Intn

func Intn(n int) int

Intn returns a int uniformly in [0, n). Safe for concurrent callers.

func Uint64

func Uint64() uint64

Uint64 returns a random uint64. Safe for concurrent callers.

func Uint64n

func Uint64n(n uint64) uint64

Uint64n returns a uint64 uniformly in [0, n). Safe for concurrent callers.

Types

type RNG

type RNG uint64

RNG is a random number generator. The zero value is valid.

func (*RNG) Float64

func (r *RNG) Float64() (v float64)

Float64 returns a float64 uniformly in [0, 1). Not safe for concurrent callers.

func (*RNG) Int

func (r *RNG) Int() int

Int returns a random positive int. Not safe for concurrent callers.

func (*RNG) Intn

func (r *RNG) Intn(n int) int

Intn returns an int uniformly in [0, n). Not safe for concurrent callers.

func (*RNG) Uint64

func (r *RNG) Uint64() uint64

Uint64 returns a random uint64. Not safe for concurrent callers.

func (*RNG) Uint64n

func (r *RNG) Uint64n(n uint64) uint64

Uint64n returns a uint64 uniformly in [0, n). Not safe for concurrent callers.

Jump to

Keyboard shortcuts

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