fastrand

package
Version: v0.0.0-...-37d926d Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package fastrand provides a fast random number generator based on xorshift

This sort of thing is frequently needed during benchmarks, and using math/rand will make create a single-threaded bottleneck. Using rand.New() is expensive so always creating multiple sources isn't always an answer either.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rng

type Rng uint64

func (*Rng) Int32n

func (r *Rng) Int32n(n uint32) uint32

func (*Rng) Intn

func (r *Rng) Intn(bound uint64) uint64

Intn returns a uniform random integer [0,bound)

func (*Rng) Next

func (r *Rng) Next() uint64

Next returns the next random number

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL