Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is a random source using xorwow algorithm. https://en.wikipedia.org/wiki/Xorshift#xorwow Marsaglia, George (July 2003). "Xorshift RNGs". Journal of Statistical Software. 8 (14).
Example ¶
package main
import (
"fmt"
"math/rand"
"github.com/shogo82148/randsrc/xorwow"
)
func main() {
src := xorwow.New(1, 2, 3, 4, 5)
r := rand.New(src)
for i := 0; i < 10; i++ {
fmt.Println(r.Int63())
}
}
Output: 778389808318630 2351421580898642 8110742959145109 1082860069128670816 9036705998592723489 3665118328779020088 7795853119066626177 4643274536627381931 8126316206436346437 8596184533766059526
Click to show internal directories.
Click to hide internal directories.