We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
PCGSource
1 parent 053ad81 commit 20a3031Copy full SHA for 20a3031
rand/rng.go
@@ -58,6 +58,17 @@ func (pcg *PCGSource) Uint64() uint64 {
58
return bits.RotateLeft64(pcg.high^pcg.low, -int(pcg.high>>58))
59
}
60
61
+// Seed64 sets both the high and low bits of the generator state to the provided values.
62
+func (pcg *PCGSource) Seed64(high, low uint64) {
63
+ pcg.high = high
64
+ pcg.low = low
65
+}
66
+
67
+// PCG returns the high and low bits of the generator state.
68
+func (pcg *PCGSource) PCG() (high, low uint64) {
69
+ return pcg.high, pcg.low
70
71
72
func (pcg *PCGSource) add() {
73
var carry uint64
74
pcg.low, carry = bits.Add64(pcg.low, incLow, 0)
0 commit comments