Source File
rand.go
Belonging Package
golang.org/x/exp/rand
package rand
import
for := 0; < ; ++ {
:= .Intn( + 1)
[] = []
[] =
}
return
}
func ( *Rand) ( []byte) ( int, error) {
if , := .src.(*LockedSource); {
return .Read(, &.readVal, &.readPos)
}
return read(, .src, &.readVal, &.readPos)
}
func ( []byte, Source, *uint64, *int8) ( int, error) {
:= *
:= *
, := .(*PCGSource)
for = 0; < len(); ++ {
if == 0 {
if != nil {
= .Uint64()
} else {
= .Uint64()
}
= 8
}
[] = byte()
>>= 8
--
}
* =
* =
return
}
var globalRand = New(&LockedSource{src: NewSource(1).(*PCGSource)})
var _ *PCGSource = globalRand.src.(*LockedSource).src
func ( uint64) { globalRand.Seed() }
func () int64 { return globalRand.Int63() }
func () uint32 { return globalRand.Uint32() }
func () uint64 { return globalRand.Uint64() }
func () int32 { return globalRand.Int31() }
func () int { return globalRand.Int() }
func ( int64) int64 { return globalRand.Int63n() }
func ( int32) int32 { return globalRand.Int31n() }
func ( int) int { return globalRand.Intn() }
func () float64 { return globalRand.Float64() }
func () float32 { return globalRand.Float32() }
func ( int) []int { return globalRand.Perm() }
func ( int, func(, int)) { globalRand.Shuffle(, ) }
func ( []byte) ( int, error) { return globalRand.Read() }
func () float64 { return globalRand.NormFloat64() }
func () float64 { return globalRand.ExpFloat64() }
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |