go语言:实现linear congruential generator线性同余发生器算法
线性同余发生器(Linear Congruential Generator, LCG)是一种常用的伪随机数生成算法。
以下是用 Go 语言实现线性同余发生器的完整源码:
package main
import (
"fmt"
)
// LCG struct represents the Linear Congruential Generator
type LCG struct {
a, c, m, seed int64
标签:generator,发生器,LCG,算法,源码,线性,同余
From: https://blog.csdn.net/it_xiangqiang/article/details/144966041