Documentation ¶
Index ¶
- func NewSource(seed ...int64) (rand.Source, error)
- type Random
- func (r *Random) ExpFloat64() float64
- func (r *Random) Fill(dest []byte) []byte
- func (r *Random) Float32() float32
- func (r *Random) Float64() float64
- func (r *Random) Int() int
- func (r *Random) Int31() int32
- func (r *Random) Int31n(n int32) int32
- func (r *Random) Int63() int64
- func (r *Random) Int63n(n int64) int64
- func (r *Random) Intn(n int) int
- func (r *Random) NormFloat64() float64
- func (r *Random) Perm(n int) []int
- func (r *Random) Read(p []byte) (n int, err error)
- func (r *Random) Seed(seed int64)
- func (r *Random) Shuffle(n int, swap func(i, j int))
- func (r *Random) Uint32() uint32
- func (r *Random) Uint64() uint64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Random ¶
type Random struct {
// contains filtered or unexported fields
}
Random is a wrapper around a math/rand random generator
func (*Random) ExpFloat64 ¶
ExpFloat64 calls ExpFloat64 from math/rand
func (*Random) Fill ¶
Fill generates random data to fill a byte array to its length. It works similarly to Read([]byte) from math/rand, except it's thread safe and it does not return an error to be handled
func (*Random) NormFloat64 ¶
NormFloat64 calls NormFloat64 from math/rand
Click to show internal directories.
Click to hide internal directories.