lcg

package
v0.0.0-...-edeb3c3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const MASK uint64 = (1 << 48) - 1 // Mask for 48 bits
View Source
const MAX uint64 = 0x0000FFFFFFFFFFFF
View Source
const ONE uint64 = 1
View Source
const ZERO uint64 = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type LCG

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

LCG is a linear congruential generator to generate pseudo-random numbers and fill out a 2^64 byte space without hitting the same number twice.

func New

func New(seed uint64) *LCG

func (*LCG) Next

func (l *LCG) Next() uint64

func (*LCG) Skip

func (l *LCG) Skip(skip int64)

type LCG48

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

LCG48 is a linear congruential generator to generate pseudo-random numbers and fill out a 2^48 byte space without hitting the same number twice.

func New48

func New48(seed uint64) *LCG48

func (*LCG48) Next

func (l *LCG48) Next() uint64

func (*LCG48) Skip

func (l *LCG48) Skip(skip int64)

Jump to

Keyboard shortcuts

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