go_LCG

package module
v0.0.0-...-efa9236 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: MIT Imports: 0 Imported by: 0

README

线性同余随机数生成

Documentation

Index

Constants

View Source
const (
	// TODO 设置合适的默认值
	DefaultA = 69069
	DefaultC = 1
	DefaultM = 4294967296
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LCG

type LCG struct {

	// 乘数
	A int

	// 增量
	C int

	// 模数
	M int

	Seed int
}

LCG 线性同余发生器

func NewLCG

func NewLCG() *LCG

func (*LCG) Next

func (x *LCG) Next() int

type LinearCongruentialGenerator

type LinearCongruentialGenerator LCG

Jump to

Keyboard shortcuts

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