Random number generator (included): Difference between revisions

→‎{{header|Go}}: add issue link, add x/exp/rand
(→‎{{header|ZX Spectrum Basic}}: slightly more detail; can't link as IE won't show the CAPTCHA and chrome won't store the cookie :/)
(→‎{{header|Go}}: add issue link, add x/exp/rand)
Line 412:
 
=={{header|Go}}==
Go has two random number packages providingin randomthe standard library and another package in the numbers"subrepository."
 
# [https://golang.org/pkg/math/rand/ math/rand] has general purpose random number support. [https://golang.org/src/pkg/math/rand/rng.go The code] attributes the algorithm to DP Mitchell and JA Reeds, and with what little I know, I would guess it's an GFSR. (It uses a large array commented "feeback register" and has variables named "tap" and "feed.")
# [https://golang.org/pkg/math/rand/ math/rand] in the standard library provides general purpose random number support, implementing some sort of feedback shift register. (It uses a large array commented "feeback register" and has variables named "tap" and "feed.") Comments in the code attribute the algorithm to DP Mitchell and JA Reeds. A little more insight is in [https://github.com/golang/go/issues/21835 this issue] in the Go issue tracker.
# [https://golang.org/pkg/crypto/rand/ crypto/rand], also in the standard library, says it "implements a cryptographically secure pseudorandom number generator." I think though it should say that it ''accesses'' a cryptographically secure pseudorandom number generator. It uses <tt>/dev/urandom</tt> on Unix-like systems and the CryptGenRandom API on Windows.
# [https://godoc.org/golang.org/x/exp/rand x/exp/rand] implements the Permuted Congruential Generator which is also described in the issue linked above.
 
=={{header|Golfscript}}==
1,707

edits